MQTT Publish on I2C-Bus

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
gahle
New user
Posts: 8
Joined: 12 Jul 2017, 07:02

MQTT Publish on I2C-Bus

#1 Post by gahle » 01 Jan 2021, 18:56

Hello,

I just try to change my SmartHomeControl to Openhab and I'm trying to talking to one ESP8266 with an PCF8574-PortExpander.
But I'm not succesfull with my work.
I'm using the EspEasy R147. Via an http-call I can switch seperately the 8 Ports of the PCF8574, but I'm not able to switch them via MQTT.

The name is = I2CSwitch, the Gpio2 is SDA and the Gpio0 is SCL.
The "Devices" are created as the following picture..
Devices.JPG
Devices.JPG (59.52 KiB) Viewed 9173 times
.
Devices.JPG
Devices.JPG (59.52 KiB) Viewed 9173 times
Has anybody an idea how to switch via MQTT-Command?
I tried in MQTT.FX it via Publish with <I2CSwitch/PCFGPIO,1,0> for switchting, but no success.

Thanks

Best Regards
gahle
Attachments
Devices2.JPG
Devices2.JPG (46.12 KiB) Viewed 9173 times

User avatar
Ath
Normal user
Posts: 3494
Joined: 10 Jun 2018, 12:06
Location: NL

Re: MQTT Publish on I2C-Bus

#2 Post by Ath » 01 Jan 2021, 19:09

Please, please, please, upgrade to a less than 4 years old release of ESPEasy (R147 is dated Q1 2017...), latest build is always available from https://github.com/letscontrolit/ESPEasy/releases

I'm no expert on MQTT, but you need to address the topic 'cmd' on that unit (so probably the topic is 'I2CSwitch/cmd'), with payload pcfgpio,1,0

It is helpful, at least for ESPEasy, to use different names for each task.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MQTT Publish on I2C-Bus

#3 Post by TD-er » 02 Jan 2021, 10:50

Yep, the main reason to use different task names is to be able to use them in rules and also in the MQTT topic the "%tskname% part will be replaced by the... task name.
So if you keep using the same name for tasks, you won't know what GPIO pin publishes its state to the MQTT broker.

Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests