@thrusty said in New plugin pimatic-mqtt:
Anyway, how can I add a backslash to a rule? I always get an error message when I want to save the rule.
Hi, this is directly from the config file. You do not specify a backslash over the GUI.
New plugin pimatic-mqtt
@thrusty said in New plugin pimatic-mqtt:
Anyway, how can I add a backslash to a rule? I always get an error message when I want to save the rule.
Hi, this is directly from the config file. You do not specify a backslash over the GUI.
Pimatic = Smart Home
@wutu
And now I’d like to get back to you,
I tried to run the command over a rule:
"rule": "when kontakt-bad is opened then set mode of therm-bad to \"manu\" and set temp of therm-bad to 10 after 2 seconds publish mqtt message \"neopixel,6,10,0,0\" on topic \"node1/cmd\"",
Pimatic deactivates the rule after restarting. I guess there’s another mistake in there somewhere.
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
@thrusty said in New plugin pimatic-mqtt:
\
@thrusty said in New plugin pimatic-mqtt:
Pimatic deactivates the rule after restarting.
deactivates why?
Test the mqtt message itself. It seems to me to be fine.
Pimatic = Smart Home
@wutu if I enter this at the terminal, it works.
mosquitto_pub -t /node1/cmd -m 'neopixel,6,10,0,0'
I tested that. then the rule is not deactivated, but it doesn’t work anyway.
"rule": "when kontakt-bad is opened then set mode of therm-bad to \"manu\" and set temp of therm-bad to 10 and publish mqtt message \"neopixel,6,10,0,0\" on topic \"node1/cmd\"",
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
@thrusty said in New plugin pimatic-mqtt:
I tested that. then the rule is not deactivated, but it doesn’t work anyway.
And why do you think it’s a mqtt-plugin problem?
Pimatic = Smart Home
@wutu said in New plugin pimatic-mqtt:
And why do you think it’s a mqtt-plugin problem
I don’t think it’s a problem with the plugin. I think it’s my problem. I don’t know enough about all this. I can rebuild a lot of things, but I always need help getting it done. Unfortunately I don’t know anything about programming and similar stuff.
With my Sonoff devices the mqtt-plugin also works very well.
I just need help getting started on this WS2812 story.
Besides, if I create a device for each LED, it also works fine. Since you’re doing it over rules, I thought I could do it the same way.
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
@thrusty said in New plugin pimatic-mqtt:
I don’t think it’s a problem with the plugin. I think it’s my problem.
Hi, I understand, but it’s totally offtopic. If you have a problem with the rules, please create a new post, preferably https://forum.pimatic.org/category/16/rules-and-scripts.
Pimatic = Smart Home
@wutu Sorry for my late reply. In the meantime, I have been able to solve my problem. And I can also enter the rule with the MQTT topic in the pimatic GUI. The backslash is then set automatically by pimatic.
My problem was that I didn’t really get along with ESPEseay. I at least flashed it on nodemcu and the result was not nice. The LES’s went uncontrolled on and off. And even with undesired colours.
Now I have flashed Tasmota (for Wemos mini) on nodemcu.
And I use this rule to switch a certain LED:
id": "gartenhaus",
"name": "GartenHaus",
"rule": "when .... then ..... publish mqtt message \"000800\" on topic \"cmnd/sonoffws/led23\" on broker 192.168.178.22",
"active": true,
"logging": true
In the GUI it looks like this and can also be edited.
Thanks for your help anyway. Sometimes you need a push in the right direction to get a good result.
Excuse me for writing the wrong topic here.
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
Hi
I need some help. I have a sonoff tH16 device flashed with Tasmato and it works fine except…
Pimatic does not pickup the state from the sonoff. Within MQTT.fx I can see the state being send when the device changes state. When I change state within Pimatic, the device responds correctly and the messages are picked up by MQTT.fx correctly. See screenprint from MQTT.fx:
Here’s my configuration:
Plugin
{
"brokers": [
{
"brokerId": "default"
}
],
"plugin": "mqtt",
"active": true
},
Device:
{
"topic": "cmnd/sonoff_vw/power",
"id": "sonoff-vw",
"name": "Vaatwasser",
"class": "MqttSwitch",
"onMessage": "on",
"offMessage": "off",
"stateTopic": "stat/sonoff_vw/POWER",
"xOnLabel": "Aan",
"xOffLabel": "Uit"
},
What could be wrong?
@jee67 said in New plugin pimatic-mqtt:
When I change state within Pimatic, the device responds correctly and the messages are picked up by MQTT.fx correctly. See screenprint from MQTT.fx:
Hi, What Tasmota sends on the topic stat/sonoff_vw/POWER
? Plugin expects on/off respectively what you have set in onMessage and offMessage.
Pimatic = Smart Home
@wutu
On the state topic stat/sonoff_vw/POWER
the Tasmota sends ‘ON’ when the device is switched on through the button or through Pimatic and ‘OFF’ when it is switched off. This is what I put in the statetopic in the device in Pimatic, however state is not changing in Pimatic when I use the pushbutton on the Sonoff. The sonoff toggles its state when I use the button and sends its state with the message stat/sonoff_vw/POWER
.
@jee67
Maybe the states are case sensitiv, have you tested:
{
"topic": "cmnd/sonoff_vw/power",
"id": "sonoff-vw",
"name": "Vaatwasser",
"class": "MqttSwitch",
"onMessage": "ON",
"offMessage": "OFF",
"stateTopic": "stat/sonoff_vw/POWER",
"xOnLabel": "Aan",
"xOffLabel": "Uit"
},
Pimatic = Smart Home
@wutu @V1per
onMessage and offMessage work fine. Device will respond to changing the state in Pimatic. If I use the button on the Sonoff it toggles state and sends a message. The answer in the message is ON or OFF with capitals.
Here’s output from mosquitto on the broker:
pi@raspberrypi-pim:~ $ mosquitto_sub -d -t "stat/sonoff_vw/POWER"
Client mosqsub/935-raspberrypi sending CONNECT
Client mosqsub/935-raspberrypi received CONNACK
Client mosqsub/935-raspberrypi sending SUBSCRIBE (Mid: 1, Topic: stat/sonoff_vw/POWER, QoS: 0)
Client mosqsub/935-raspberrypi received SUBACK
Subscribed (mid: 1): 0
Client mosqsub/935-raspberrypi received PUBLISH (d0, q0, r0, m0, 'stat/sonoff_vw/POWER', ... (2 bytes))
ON
Client mosqsub/935-raspberrypi received PUBLISH (d0, q0, r0, m0, 'stat/sonoff_vw/POWER', ... (3 bytes))
OFF
Client mosqsub/935-raspberrypi received PUBLISH (d0, q0, r0, m0, 'stat/sonoff_vw/POWER', ... (2 bytes))
ON
Client mosqsub/935-raspberrypi received PUBLISH (d0, q0, r0, m0, 'stat/sonoff_vw/POWER', ... (3 bytes))
OFF
Client mosqsub/935-raspberrypi received PUBLISH (d0, q0, r0, m0, 'stat/sonoff_vw/POWER', ... (2 bytes))
ON
Client mosqsub/935-raspberrypi received PUBLISH (d0, q0, r0, m0, 'stat/sonoff_vw/POWER', ... (3 bytes))
OFF
```
Looks like the plugin doesn't pickup the state topic correctly. Any idea how to solve this?
Please test to change on to ON and off to OFF in your config.
@v1per
Ha, that’s the trick.
So the messages in the command topics should be the same as in the state topic.
@jee67 said in New plugin pimatic-mqtt:
@v1per
So the messages in the command topics should be the same as in the state topic.
Exact, good that it works now.
@jee67 ,
you are a view steps further than myself. Thanks for the thread.
One question however that I can’t understand at this moment: what MQTT settings do you have on the Sonoff itself?
I mean this list:
MQTT Host 192.168.xxx.xxx
MQTT Port 1883
MQTT Client &
Fallback Topic DVES_2EC3FD
MQTT User DVES_USER
MQTT Topic sonoff
MQTT Group Topic sonoffs
MQTT Full Topic cmnd/sonoff/
(this is the default after flashing. I’m struggliing what needs to go in here)
@jeroen
Hi,
These are the settings for MQTT in my sonos:
So host is the ip adress where your mqtt broker runs. Client is what you want, I choose to make it the same as the topic. If you have no authenitcation on your broker, you can leaver user (gebruiker) and password (wachtwoord) at the deault values.
Hope this will help.
Hi all,
I got my Sonoff’s working which means I can swicth them on/off from the pimatic interface.
My last hurdle seem to be the temperature sensor reading.
I’m looking at a TH10 and have also a Sonoff DS18B20 module (that is including a mini-jack connector that is meant to go in the Sonoff at the side ( no soldering); I assumed that this is GPIO4?
I just can’t figure out the correct device-declaration inside Pimatic to read the temps for it.
As a matter of fact I even doubt if the temporature sensor works as it seems that nowhere in the webconole the module or temparture it’s shown (not sure if this is meant to be)
I tried to send several http command to the Sonoff to test and get readings but no response yet that looks like a temperature reading.
while other http-commends like “http://sonoffTH10/cm?cmnd=power” give the expected responses
"RESULT = {“POWER”:“OFF”}
POWER = OFF"
Thanks for any guidance or tips
printscreens:
https://screenshots.firefox.com/g98DFKPMiCrvKwBE/192.168.13.195
https://screenshots.firefox.com/BydIGRkSUD6sOKF9/192.168.13.195
https://screenshots.firefox.com/ktX1u2KyVlQNNR0E/192.168.13.195
Thanks.