question

deonkorb avatar image
deonkorb asked

Emulate Temperature Sensor

I have a temperature sensor in my MQTT namespace and would like to be able to see it on VRM, similar to how a Ruuvi or a tank sensor would behave.

Is there a way to write the value into the system for it to appear? I couldn't see any Node-RED nodes that make sense. The tank sensor read node rightfully says I don't have any sensors. Maybe some magic with the custom nodes?

I saw this post, but not quite applicable:

https://community.victronenergy.com/questions/36821/temperature-sensors-1.html

I would appreciate someone pointing me in the right direction.

Node-RED
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

deonkorb avatar image deonkorb commented ·

I also saw this:

https://community.victronenergy.com/questions/121807/generic-driver-for-mqtt-devices-using-dbus-mqtt-db.html


I am a bit hesitant to dive too deep into the Venus OS. Is this the only way?

0 Likes 0 ·
1 Answer
matt1309 avatar image
matt1309 answered ·

Hi @deon.korb


Here's an exaplanation of making a custom driver/virtual tank sensor. You would just edit this to be a temp sensor. Then you will be able to send info via mqtt into the device.


howto add a driver to Venus · victronenergy/venus Wiki · GitHub

Example script:

velib_python/dbusdummyservice.py at master · victronenergy/velib_python · GitHub


Alternatively you can write it into python to "get the info from MQTT" rather than send the info to venus os MQTT (sending to venus os mqtt is easier though in my opinion).


There's a shelly energy meter driver written by the community on github hat could also be useful as an example.


in the example above you'd need to change line 87 from com.victronenergy.dummyservice.ttyO1

to

com.victronenergy.temperature.tty01


And then the paths you'd populate would be the ones under temperature heading in this link:

dbus · victronenergy/venus Wiki · GitHub


This will make the "virtual device" and have it appear in dbus-spy. To get data into that virtual device you can send via mqtt. alterantively you could edit the custom driver to get the information from another source be it http endpoint or your own mqtt server.


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.