@moskovskiy82 You will find the discussion in the threads if searching. The current v1.5 gateway is a (rough) broker with some problems (even though mine has run well for a long time).
The next one is a MQTT client and is based on ESP8266 and is available from the development branch at GitHub. Using this you also need a broker, for example Mosquitto, somewhere in the network.
I have just installed Mosquitto at my Openhab RPi gateway and will start testing the WSP8266 MQTT gateway client one of these days. I have already run it for a few minutes and it worked so far.
OK got it !!! It was a combination of more failures - with the main one not having read the name of the status message carefully enough : ItemStateChanged(!!!)Event. So as long as battery level is the same ...
Thanks for the suggestion. I found another solution.
I have the item like this:
Switch Incalzire_Releu_GF_Living1 "Incalzire Releu Living 1" <heating> (Incalzire) {mqtt=">[mysensor:MyMQTT/3/1/V_HEATER_SW:command:ON:1],>[mysensor:MyMQTT/3/1/V_HEATER_SW:command:OFF:0],<[mysensor:MyMQTT/3/1/V_HEATER_SW:command:MAP(1on0off.map)]"}
and in 1onoff.map i have:
**1=ON
0=OFF
1.4.1=REQUEST
**
And then I have a rule:
rule "SW1 Persist"
when
Item Incalzire_Releu_GF_Living1 received command
then
if (receivedCommand == "REQUEST")
{
sendCommand(Incalzire_Releu_GF_Living1 , Incalzire_Releu_GF_Living1.state);
}
end
In the arduino code for the relay I have in the setu() this code.
**void setup()
{
gw.begin(incomingMessage, AUTO, true);
gw.sendSketchInfo("Relay Control", "1.0");
for (int sensor=1 ; sensor<=NUMBER_OF_RELAYS;sensor++)
{
gw.present(sensor, S_HEATER);
gw.request(sensor, V_HEATER_SW,0);
}
}**
So whenever gw.request is called the idem receives an update with 1.4.1 that is resolved by the rule to the actual state of the switch in openhab.
Like this, when arduino starts, the relays will be swiched ON as per the actual state of the switch.
I get this in my log sometimes:
[WARN ] [.discovery.MySensorsDiscoveryService] - Cannot automatic discover thing node: 0, child: 255 please insert it manually
I use MySensors Binding 2.3.0.201801160936 on a serial gateway with mysensors 2.2.0
Where shall I insert the thing node and what should it look like?
@Eric-Buhring I found that changing the line in the my sensors program that sends the message as below allowed me to use a Contact rather than a Switch
if (value != sentValue2) {
// Value has changed from last transmission, send the updated value
send(msg2.set(value==HIGH?"OPEN":"CLOSED"));
sentValue2 = value;
}