@thrusty said in New plugin pimatic-mqtt:
/ESP_Easy/neo neopixelall,255,255,255
You used the example wrong. The command is:
/ESP_Easy/cmd neopixelall,255,255,255
New plugin pimatic-mqtt
@thrusty said in New plugin pimatic-mqtt:
/ESP_Easy/neo neopixelall,255,255,255
You used the example wrong. The command is:
/ESP_Easy/cmd neopixelall,255,255,255
Pimatic = Smart Home
@wutu Thank you for your help and patience.
I finally made it today.
Here is my setting for the device:
"brokerId": "192.168.178.22",
"topic": "/ESP_Easy/neo/cmd",
"onMessage": "NeoPixel,5,0,50,0",
"offMessage": "NeoPixel,5,0,0,0",
"echo": {
"additionalNames": []
},
"id": "ws2812",
"name": "ws2812",
"class": "MqttSwitch"
},
And setting the number of LEDs is also important.
Only as many LEDs light up as you have specified.
"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:
“topic”: “/ESP_Easy/neo/cmd”
I’m glad it works. Btw, “neo” in your topic is ignored by ESPEasy.
Pimatic = Smart Home
@wutu
Hello again, now I’ve come this far. Apart from the fact that my nodemcu has been smoked because an ordered display (i2c 2004) was soldered incorrectly.
Anyway, how can I add a backslash to a rule? I always get an error message when I want to save the rule.
As an example, like yours:
"when every 10 seconds and if $coal-level-simple-truncated-mean.coal-level-simple-truncated-mean > 50 and if $coal-level-simple-truncated-mean.coal-level-simple-truncated-mean < 65 then publish mqtt message **\**"neopixel,8,40,0,40**\**" on topic \"mh/gf/lab/wd1mini-9/cmd\" and after 2 seconds publish mqtt message **\**"neopixel,8,0,0,0\" on topic \"mh/gf/lab/wd1mini-9/cmd\""
I have, of course, adapted all the settings to my circumstances.
As soon as I insert a backslash in a Rule I get an error message.
"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:
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.