• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using a different unit for on and off
#1
Hi,

I have search both the forum and web and cant find a way to code having a different unit No for on and off

sudo pilight-send -p techlico_switch -i 3840 -u 2 -t 

sudo pilight-send -p techlico_switch -i 3840 -u 1 -f 

basically i want to use the above send strings. As a hack i created two GUI entries, one for off and on for ON but i am sure there is a better way to do this, as I have 3 of these lamp base switches.

regards
Stuart
 
Reply
#2
Have you tried adding multiple ID's to the switch? Not sure if both ID's are also sent or only triggered on a receive.
 
Reply
#3
(02-15-2018, 10:28 AM)curlymo Wrote: Have you tried adding multiple ID's to the switch? Not sure if both ID's are also sent or only triggered on a receive.
Thanks for the suggestion but I have already tried this 2 IDs code from the examples but used the same ID. This produces an error. What i need is to be able to use different unit codes for on and off. 

        "id": [{
       "id": 3840,
       "unit": 2
     },
     {
       "id": 3840,
       "unit": 1
     }],
 
Reply
#4
Can you start using code tags please.

Having to use different unit codes shouldn't be necessary so why is that?
 
Reply
#5
(02-15-2018, 07:19 PM)curlymo Wrote: Can you start using code tags please.

Having to use different unit codes shouldn't be necessary so why is that?

I dont understand your comment. 

How do i code in json the following, in other words sending the same ID but a different unit code for on (unit: 2) and off (unit: 1):
Code:
sudo pilight-send -p techlico_switch -i 3840 -u 2 -t

sudo pilight-send -p techlico_switch -i 3840 -u 1 -f
In fact the -t or -f is irrelevant to turning the light on or off, changing the unit code is the only action that works.
 
Reply
#6
You are either using a device not supported by the protocol or the protocol is broken. It's as simple as that.
 
Reply
#7
(02-16-2018, 09:37 AM)curlymo Wrote: You are either using a device not supported by the protocol or the protocol is broken. It's as simple as that.

Ok, so you are saying there is no way to use pilight Json to have a different plight-send string for on and off. Therefore the hack i have created to have a LAMP-ON and a LAMP-OFF is the only solution.

thanks.

I have seen that home assistant has json code to allow different codes for on and off so i guess at some stage i need to switch over.

thanks for your feedback
Stu...
 
Reply
#8
Or we can fix the protocol.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  KaKu YCT-102 remote unit and id Blacklight 2 1,886 08-14-2016, 08:02 PM
Last Post: Blacklight

Forum Jump:


Browsing: 1 Guest(s)