Pilight setup issue

So I have pilight set up and everything seems to be working from within pilight. My issue is that I can’t seem to get home assistant talking to pilight properly. I have it all set up properly in my config.yaml for home assistant and don’t get any errors there, but when I try to send a command to pilight I get this error.

ERROR (Thread-8) [homeassistant.components.pilight] Pilight send failed for {'state': 'on', 'id': 'A2', 'unit': 20, 'protocol': ['clarus_switch']}

I’ve sent the command using pilight-send and it works properly so I think the issue is with how home assistant sends the command.

This is my switch config in home assistant.

  - platform: pilight
    switches:
      Bedroom Fan:
        on_code:
          protocol: clarus_switch
          unit: 20
          id: A2
          state: 'on'
        off_code:
          protocol: clarus_switch
          unit: 20
          id: A2
          state: 'off'
        on_code_receive:
          protocol: clarus_switch
          unit: 20
          id: A2
          state: 'on'
        off_code_receive:
          protocol: clarus_switch
          unit: 20
          id: A2
          state: 'off'

And this is my pilight config.

{
	"devices": {
		"switch1": {
			"protocol": [ "clarus_switch" ],
			"id": [{
				"id": "A2",
				"unit": 20
			}],
			"state": "on"
		},

Any ideas on how to make this work? I’ve read a bunch and haven’t gotten any closer to it working, any help is appreciated.

My switch.yaml
pilivingroomgardencam:
on_code:
protocol: kaku_switch_old
unit: 15
id: 25
‘on’: 1
off_code:
protocol: kaku_switch_old
unit: 15
id: 25
‘off’: 0
on_code_receive:
protocol: kaku_switch_old
unit: 15
id: 25
state: ‘on’
off_code_receive:
protocol: kaku_switch_old
unit: 15
id: 25
state: ‘off’

    Config.json
    		"pilivingroomgardencam": {
    			"protocol": [ "kaku_switch_old" ],
    			"id": [{
    				"id": 25,
    				"unit": 15
    			}],
    			"state": "on"
    		}
    	},

I think your state on should be on: 1 and similar for off in your on and off code statements, hmm forum won’t format the yaml for some reason :frowning:

On man, I’m an idiot. I guess I was misreading the documentation for it. I was confused since all of it is listed underneath in one group. That fixed it, thank you!

Glad to help :smiley: