ESP8266 Outputs?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
4711Austria
Normal user
Posts: 19
Joined: 06 Aug 2021, 12:52

ESP8266 Outputs?

#1 Post by 4711Austria » 06 Aug 2021, 16:01

Hello!

How do I configure Outputs, can not find a presetting for it? (Test_A)

Sry for stupid questions, still starting.

THX

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

Re: ESP8266 Outputs?

#2 Post by Ath » 06 Aug 2021, 16:04

You can set a GPIO using the GPIO command from a rule, or send an external command using the http://esp_ip_address/control?cmd="gpio,2,0" syntax.

Rules need to be enabled on the Tools/Advanced page before you can use that.
/Ton (PayPal.me)

4711Austria
Normal user
Posts: 19
Joined: 06 Aug 2021, 12:52

Re: ESP8266 Outputs?

#3 Post by 4711Austria » 06 Aug 2021, 16:10

Outputs are switched via ioBroker over Mqtt.

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

Re: ESP8266 Outputs?

#4 Post by Ath » 06 Aug 2021, 16:11

There are also the Domoticz Helper and MQTT Import plugins that enable getting (numeric) data to your ESP, Domoticz Helper can directly set a GPIO pin to a state (or inverted), and MQTT Import generates events when receiving a value

(event: Import#value=<numeric-value>)
Handle such event:

Code: Select all

on Import#value do
  if %eventvalue1% > 23
    GPIO,2,1 // Turn fan on
  endif
  if %eventvalue1% < 20
    gpio,2,0 // turn fan back off (with a hysteresis built in)
  endif
endon
/Ton (PayPal.me)

4711Austria
Normal user
Posts: 19
Joined: 06 Aug 2021, 12:52

Re: ESP8266 Outputs?

#5 Post by 4711Austria » 06 Aug 2021, 16:13

OK, thx.
But I do not even have a clue where I should start and program that?

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

Re: ESP8266 Outputs?

#6 Post by Ath » 06 Aug 2021, 16:16

4711Austria wrote: 06 Aug 2021, 16:10 Outputs are switched via ioBroker over Mqtt.
Then the best MQTT controller to use would be the Home Assistant (openHAB) MQTT controller, as that has the feature of sending the %sysname%/cmd topic with a command in the payload, assuming the MQTT Controller subscriibe field is set to %sysname%/#
(When sending from ioBroker, %sysname% should be replaced with the ESP's Client ID, as shown on the Controller page.)
/Ton (PayPal.me)

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

Re: ESP8266 Outputs?

#7 Post by Ath » 06 Aug 2021, 16:16

4711Austria wrote: 06 Aug 2021, 16:13 OK, thx.
But I do not even have a clue where I should start and program that?
More reading to do: :lol:
https://espeasy.readthedocs.io/en/lates ... Rules.html
/Ton (PayPal.me)

4711Austria
Normal user
Posts: 19
Joined: 06 Aug 2021, 12:52

Re: ESP8266 Outputs?

#8 Post by 4711Austria » 06 Aug 2021, 16:18

SHT31 is working fine via Home Assist and Mqtt to ioBroker (Sonoff).
Inputs are not shown in ioBroker? (other thread)
Only Outputs I do not understand, how should I configure that Pin ? missing a Device to configure.

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

Re: ESP8266 Outputs?

#9 Post by TD-er » 06 Aug 2021, 16:52

When using the OpenHAB MQTT controller you can also send commands to ESPEasy.
For this you need to publish a message to the topic your controller subscribes to, with "/cmd" appended to the topic.

4711Austria
Normal user
Posts: 19
Joined: 06 Aug 2021, 12:52

Re: ESP8266 Outputs?

#10 Post by 4711Austria » 06 Aug 2021, 17:03

I do not know how that works, normaly I just switch the Object in ioBroker, the Adapter does the Mqtt.

4711Austria
Normal user
Posts: 19
Joined: 06 Aug 2021, 12:52

Re: ESP8266 Outputs?

#11 Post by 4711Austria » 08 Aug 2021, 07:55

Switching over Mqtt Cmd is an option.

But is there not a Device to show the Output?

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

Re: ESP8266 Outputs?

#12 Post by Ath » 08 Aug 2021, 10:10

You can use a Switch to show the state of a GPIO pin, I use that to have the second Led of my Sonoff S20s visible in the UI.
Do not expect you can change that gpio pin-state using that device though, you'll need a regular 'gpio,<pin>,<state>' command for that 8-)
/Ton (PayPal.me)

4711Austria
Normal user
Posts: 19
Joined: 06 Aug 2021, 12:52

Re: ESP8266 Outputs?

#13 Post by 4711Austria » 08 Aug 2021, 10:48

OK thx.

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests