Page 1 of 1

Own sensor. Where to start?

Posted: Thursday 30 May 2019 10:17
by capitalT
Hello,

I have made my own Arduino sensor that can communicate over the network. It is a simple alarm that can be either "High" or "Low" and I can craft my own HTTP requests.

My first question is, what is the best approach to connect it to Domoticz?
- Create a device in Domoticz an talk to the API directly? Or set a user variable?
- Let the device talk to an other script on the Domoticz server that will talk to Domoticz?
- Use MySensor or MQTT? (no experience with that)

When creating a sensor, what type?
- An Alert sensor
- A Selector Switch
- Custom Sensor

The custom sensor gives a gradient in the graph, where in reality the alarm is either "on" or "off", more like a light switch. The alert sensor comes closest to what the device does and multiple alarms could raise the "warning level".
Is adding your own device type to Domoticz an option?

Could someone point me in the right direction?

Re: Own sensor. Where to start?

Posted: Thursday 30 May 2019 10:42
by Thorgal789
Hello, if you can talk directly to domoticz, why do you want to use MQTT, if you don't need something, don't use it, better to have less protocol/software layer.

And yes, I will take like you the alert sensor, custom sensor is awfull for logs, you can't disable it, and it make 1 record all 5mn for nothing.

Re: Own sensor. Where to start?

Posted: Friday 31 May 2019 22:53
by capitalT
Thanks. I will venture down that path ;)

Re: Own sensor. Where to start?

Posted: Saturday 01 June 2019 3:13
by moroen
You could also look at creating a python plugin... The plugin framework supports HTTP-requests directly, so if your sensor has some kind of HTTP-based API it should be quite manageable.

Regards,
M