How can I change the state for the Relay

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
nolimal.design
Normal user
Posts: 10
Joined: 16 Sep 2022, 14:48

How can I change the state for the Relay

#1 Post by nolimal.design » 16 Sep 2022, 15:36

Hello,

this is my (first) ESP8266 with ESPEasy + 2x DS18b20 + 8CH Relay Card.

What is my wish and my question!

1. Is it possible, Rules 1 to change in one line?

2. How can I change it, that the Relay (GPIO-5 D1) shows me the correct state "0" if he is off?

Question 1 is not so important, but the second I need for my iobroker sqldb.

I have 2 Rules:

Rules 1

Code: Select all

On System#Boot do
timerSet,1,1
endon
On Rules#Timer=1 do
TaskValueSet 5,1,(42.5-[TempExtern#temperature])
TaskValueSet 6,1,([Temp1#Dummy]*1.30)
timerset,1,1
endon
Rules 2

Code: Select all

on Relay1#State do
 if [Temp2#Dummy]>[TempWater#temperature]
  gpio,5,0
 else
  gpio,5,1
 endif
endo
Attachments
Devices.PNG
Devices.PNG (122.01 KiB) Viewed 2094 times

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

Re: How can I change the state for the Relay

#2 Post by TD-er » 16 Sep 2022, 19:22

Why do you need the rules to be a oneliner?
You can always create your own event and send that event including eventvalues as a oneliner from another application.
This way you can also use command which are restricted and thus cannot be called from a remote host.

nolimal.design
Normal user
Posts: 10
Joined: 16 Sep 2022, 14:48

Re: How can I change the state for the Relay

#3 Post by nolimal.design » 16 Sep 2022, 20:45

Thanks,

and I understand what you mean.

For my second question here my problem in iobroker with habpanel.

The ESP (State) and the Relay (HabPanel) show that he is "ON" but he "OFF", and when he change to "ON" the ESP and the Relay shows "OFF".
Attachments
habpanel_heating.PNG
habpanel_heating.PNG (77.43 KiB) Viewed 2082 times

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

Re: How can I change the state for the Relay

#4 Post by Ath » 16 Sep 2022, 21:05

Have you tried the "Inversed Logic" setting on the Switch device?
/Ton (PayPal.me)

nolimal.design
Normal user
Posts: 10
Joined: 16 Sep 2022, 14:48

Re: How can I change the state for the Relay

#5 Post by nolimal.design » 16 Sep 2022, 21:24

Thank you so much,

I changed now, and now it's working perfect!

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

Re: How can I change the state for the Relay

#6 Post by Ath » 16 Sep 2022, 22:06

Great! :)
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests