openhab send message to mysensors, serial, mysensorbinding
-
Hi
I have a openhab instance running on a linux machine.
That openhab is connected to mysensor via a serial gateway.I have managed to receive data via the serial gateway.
I have two powermeter sensors which request value from openhab during startup.So it seems that it is possible to send message from openhab to mysensors.
receiving is not a problem.But I would like to send the same value in a rule also. How do I do that?
The rule ..// nollställer pulsecounter varje midnatt rule "Midnight" when Time cron "0 59 23 * * ? " then var Number zero = 0 postUpdate(my_nibe_pulsecount,zero) //sendCommand(Arduino, my_nibe_pulsecount) or something similar??? logInfo("logg"," reset pulscounters") end
This is the Item i want to send from openhab to mysensors.
Number my_pulsecount "V_VAR1 (pulse count) [%d]" {mysensors="10;1;V_VAR1"}
-
After some testing I reporduce the command that I want be able to send from the rule in openhab to mysensor.
I_LOG_MESSAGE: send: 0-0-5-10 s=1,c=1,t=24,pt=0,l=8,sg=0,st=ok:13237476
So with this code it works !!
my_nibe_pulsecount.sendCommand(0)
-
This has been solved!
Hi @stoffej!
Can you please try to assist me on a very similar topic?
I've built the EnergyMeterPulseSensor.ino pulse count sensor from the 2.0 library but I'm unable to initialize the items and I'm quite certain that this is why I'm not getting any values into Openhab. The Arduino is waiting for a request to be acknowledged which I guess is not happening.
I have enabled persistence for the pulse counter items and I've also tried to initialize the items by manually sending a value through the openhab console (telnet localhost 5555). After updating the values manually I can see the new value in the sitemap-GUI but the actual counting does not start.
After restarting Openhab the following is shown in the log:
... - New Item "myPCVar (Type=NumberItem, state=Uninitialized) based on configuration "50;1;V_VAR1"
A funny thing is that I actually got it working while working on the pulse counter on an experimental setup without actually trying to initialize the items. I don't know what I did at that time or if it started working just by chance.
Do you have any ideas of what steps to try? Thanks!
Ah forget what I wrote. Its working now. I guess it was a poor radio module which seems to be the reason in a lot of cases.
Suggested Topics
-
Boxes and Enclosures
Enclosures / 3D Printing • 29 Mar 2014, 21:02 • PITP2 31 Aug 2014, 19:27 -
openHAB 4 MySensors Binding
OpenHAB • 1 Aug 2023, 22:19 • ben999 7 Feb 2024, 14:25 -
openHAB 2.5 binding and V_VARx
OpenHAB • 25 May 2020, 15:49 • syntacrsc 4 May 2022, 20:47 -
OH3 - MySensors Binding
OpenHAB • 17 Dec 2020, 16:35 • Peter Loeffler 3 Dec 2023, 09:37 -
openHAB 2.2 binding
OpenHAB • 18 Jul 2017, 12:49 • TimO 23 Dec 2020, 14:32 -
openhab binding mysensors
OpenHAB • 14 Mar 2021, 18:44 • MDS 15 Mar 2021, 21:56