how do you include a water level sensor device in rainmaker?

chopinskiii
Posts: 1
Joined: Fri Mar 08, 2024 1:19 pm

how do you include a water level sensor device in rainmaker?

Postby chopinskiii » Fri Mar 08, 2024 1:22 pm

i mean, reading temperature and humidity values from a dht11 sensor is fairly easy since you can just declare:

Code: Select all

TemperatureSensor temperature("Temperature");
TemperatureSensor humidity("Humidity");
but i also want to read values from my water level sensor and this is where i get stumped. i've checked the rainmaker documentation numerous times already but there is no specific type for adding this kind of device:

Code: Select all

Standard Devices

Classes are defined for the standard devices.

Creating object of these class creates the standard device with default parameters to it.

Class for standard devices

Switch

LightBulb

TemperatureSensor

Fan
or yknow, maybe i'm just missing something? how can i include the water level sensor to my rainmaker app? any help is much appreciated 🙏

ESP_Piyush
Posts: 309
Joined: Wed Feb 20, 2019 7:02 am

Re: how do you include a water level sensor device in rainmaker?

Postby ESP_Piyush » Wed Mar 13, 2024 11:59 am

Water level sensor is not a standard device/parameter, so you will have to create custom ones

Eg.
custom device:
my_device = new Device("Water Sensor", "my.device.water-sensor", NULL);

custom param:
Eg. Param sensor("Level", "my.param.water-level", value(0), PROP_FLAG_READ);

Add custom param to the custom device
my_device->addParam(sensor);

You can check out some related conversations here.

Who is online

Users browsing this forum: No registered users and 86 guests