Topic-icon Home Assistant

  • Christian
  • Christians Avatar Autor
  • Offline
  • Junior Boarder
  • Junior Boarder
Mehr
07 Feb 2022 16:53 #1 von Christian
Home Assistant wurde erstellt von Christian
Hello,

Is there someone who has integrated PHC in Home Assistant ?

I'm starting like this :

switch:
  - platform: command_line
    switches:
        spots_hallway:
          command_on: curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=0&EVT=3"
          command_off: curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=1&EVT=3"
          friendly_name: "Lights hallway"

And use it like this

  - type: button
    tap_action:
      action: call-service
      service: rest_command.spots_hallway
      service_data: {}
      target: {}
    show_state: false
    name: Spots
    show_name: false
    icon: mdi:light-recessed


First I see a message in the log (even if it works fine) : Command failed: curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=0&EVT=3"


Second and the most important one is that of course home assistant don't know the status of the switch.

Do someone knows how I can do that ?

Thanks !

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
07 Feb 2022 17:45 - 07 Feb 2022 17:49 #2 von Oude Maatman
Oude Maatman antwortete auf Home Assistant
I integrated PHC commands into Homeassistant by using the commands below

reading the status is not possible but in homeassistant it is indicated that the lamp is on after command is given. The icon of the lamp turns yellow and the slide turns blue.
below the command I used to convert the switch to a lamp

- platform: template
   lights:
     spots_hallway:
       friendly_name: 'spots hallway'
       turn_on:
         service: homeassistant.turn_on
          entity_id: switch.spots_hallway
       turn_off:
           service: homeassistant.turn_off
           entity_id: switch.spots_hallway


succes
Letzte Änderung: 07 Feb 2022 17:49 von Oude Maatman.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

  • Christian
  • Christians Avatar Autor
  • Offline
  • Junior Boarder
  • Junior Boarder
Mehr
07 Feb 2022 18:15 #3 von Christian
Christian antwortete auf Home Assistant
That's indeed nicer in ha. Thanks !

Unfortunately I see still the error in the log.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
07 Feb 2022 18:55 - 07 Feb 2022 18:57 #4 von Oude Maatman
Oude Maatman antwortete auf Home Assistant
Hallo Christian,

Delete the friendly name command under
  - platform: command_line

Monique
Letzte Änderung: 07 Feb 2022 18:57 von Oude Maatman.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

  • Christian
  • Christians Avatar Autor
  • Offline
  • Junior Boarder
  • Junior Boarder
Mehr
08 Feb 2022 09:24 - 08 Feb 2022 09:27 #5 von Christian
Christian antwortete auf Home Assistant
Hi Monique,

Unfortunately I still get the error ?


  - platform: command_line
    switches:
        verlichting_hallway:
          command_on: 'curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=0&EVT=3"'
          command_off: 'curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=1&EVT=3"'
        verlichting_bathroom:
          command_on: 'curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=2&EVT=3"'
          command_off: 'curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=3&EVT=3"'
...

  - platform: template
    lights:
      lights_hallway:
        friendly_name: "Lichten gang"
        turn_on:
          service: homeassistant.turn_on
          entity_id: switch.verlichting_hallway
        turn_off:
          service: homeassistant.turn_off
          entity_id: switch.verlichting_hallway
      lights_bathroom:
        friendly_name: "Lichten badkamer"
        turn_on:
          service: homeassistant.turn_on
          entity_id: switch.verlichting_bathroom
        turn_off:
          service: homeassistant.turn_off
          entity_id: switch.verlichting_bathroom
...

Even when deleting the friendly name under "platform: template" nothing helps...
Letzte Änderung: 08 Feb 2022 09:27 von Christian.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
08 Feb 2022 16:47 #6 von Oude Maatman
Oude Maatman antwortete auf Home Assistant
You cannot read a status in HA for the PHC system in HA for a lamp(but also shutters not). 
By turning the lamp on or off the system expects to get a status message back but this does not happen. Therefore the error message. You can ignore this 
see also www.home-assistant.io/integrations/light.template/

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

  • Christian
  • Christians Avatar Autor
  • Offline
  • Junior Boarder
  • Junior Boarder
Mehr
08 Feb 2022 17:32 #7 von Christian
Christian antwortete auf Home Assistant
Thank you for the clarification !

Strange (and very unfortunate) that no one on the forum has managed to achieve that status (mqtt ?).

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Powered by Kunena Forum