Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. xlcnd
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    xlcnd

    @xlcnd

    3
    Reputation
    12
    Posts
    431
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    xlcnd Follow

    Best posts made by xlcnd

    • RE: An HASS service to send messages to nodes

      Let me complete the example given for the node when you use V_IR_SEND.

      In order to send IR codes you need to transform the
      code in an unsigned long:

          char ircode[11] = {0};  // in case your code takes the form of 0xE0E0FF0F
          ...
          if (message.type == V_IR_SEND) {
            String hexstring = message.getString();
            hexstring.toCharArray(ircode, sizeof(ircode));
            ...
            // get the code as an unsigned long
            unsigned long code = strtoul(ircode, NULL, 0);
      
            // with IRLib send the code to TV
            sendSAMSUNG(code);
            ...
      

      Very simple, ** but is hard to find an example**!

      posted in Home Assistant
      xlcnd
      xlcnd
    • RE: An HASS service to send messages to nodes

      Hi,

      Thanks for your promptly reply.

      I have a node that acts like a IR remote to one of the newest Samsung TVs. This node runs a sketch that extracts IR codes from received messages and send them to TV and returns a feedback message to HASS. The node (with id 40) has a child sensor (with id 3) and his of type S_IR and accepts messages with type V_IR_SEND. In HASS this (ms)sensor is defined as a sensor (his identity_id is sensor.ir_remote) and displays the IR code that was sent, but there is no way in HASS to send a given IR code (for instance in automation) to this node... so a service to do that would be nice.

      posted in Home Assistant
      xlcnd
      xlcnd

    Latest posts made by xlcnd

    • RE: An HASS service to send messages to nodes

      Let me complete the example given for the node when you use V_IR_SEND.

      In order to send IR codes you need to transform the
      code in an unsigned long:

          char ircode[11] = {0};  // in case your code takes the form of 0xE0E0FF0F
          ...
          if (message.type == V_IR_SEND) {
            String hexstring = message.getString();
            hexstring.toCharArray(ircode, sizeof(ircode));
            ...
            // get the code as an unsigned long
            unsigned long code = strtoul(ircode, NULL, 0);
      
            // with IRLib send the code to TV
            sendSAMSUNG(code);
            ...
      

      Very simple, ** but is hard to find an example**!

      posted in Home Assistant
      xlcnd
      xlcnd
    • RE: An HASS service to send messages to nodes

      It works like a charm in version 0.22.1.

      For complex sequences of IR codes, I just send a 'fake' code and then the node selects the appropriate sequence.

      Thanks again!

      posted in Home Assistant
      xlcnd
      xlcnd
    • RE: An HASS service to send messages to nodes

      Thanks!

      I am traveling but as soon as I get home I will test it.

      posted in Home Assistant
      xlcnd
      xlcnd
    • RE: An HASS service to send messages to nodes

      @martinhjelmare Great!

      posted in Home Assistant
      xlcnd
      xlcnd
    • RE: An HASS service to send messages to nodes

      @martinhjelmare Yes, I know that a sensor is read only, but it is important that the state is available on HA, how will you do it with a switch?

      posted in Home Assistant
      xlcnd
      xlcnd
    • RE: An HASS service to send messages to nodes

      @martinhjelmare In that case it will be VERY useful.

      I have been playing with HA and LIRC on a Raspberry Pi (that acts as a remote near one of the new Samsung TVs) and found that the ability to send an IR code from HA is only useful for 'direct functions' like POWER, MUTE, SOURCE, VOL UP and VOL DOWN. Due to security reasons the appliance manufacturer's are limiting these cases and relying on context codes, like using arrows to select the appropriate choice, this makes the remote a not very useful concept to use in automation! Fortunately, if HA sends a code that represents the final goal (e.g. goto BBC), instead of the IR code, it is relatively easy to guess the appropriated steps in the node and send a sequence of codes to the appliance. The logic for that is better to be in the node not in HA because, even if in HA you know the sequence of IR codes, playing directly these codes in the node, make the process very unreliable (a small delay in the transmission and you will end up on Fox News instead!).

      So your solution, in fact, is BETTER than a generic remote.

      However, I don't see advantages to move 'IR send' to a switch, let it stay as a sensor whose state is the 'last code sent' together with a service that sends messages to that sensor... anyway this is a thing that will be useful for automation not so much as a UI gadget

      posted in Home Assistant
      xlcnd
      xlcnd
    • RE: An HASS service to send messages to nodes

      @martinhjelmare But would be possible to change that attribute in automation? E.g., could the same switch receive several codes?

      If not, this will not be a major improvement relative to the present situation...

      posted in Home Assistant
      xlcnd
      xlcnd
    • RE: An HASS service to send messages to nodes

      In the next version of HASS there is a new component that will do this (acting as an IR remote), however doesn't use mysensors but LIRC and a Raspberry Pi...

      posted in Home Assistant
      xlcnd
      xlcnd
    • RE: An HASS service to send messages to nodes

      @xlcnd

      By the way, for now I implemented some of more useful function by using several child sensors of the type S_LIGHT and with the help of 'boolean' logic I select the intended IR code. But this produces complex sketches and a fair amount of rules in automation... just to send a code!

      posted in Home Assistant
      xlcnd
      xlcnd
    • RE: An HASS service to send messages to nodes

      Hi,

      Thanks for your promptly reply.

      I have a node that acts like a IR remote to one of the newest Samsung TVs. This node runs a sketch that extracts IR codes from received messages and send them to TV and returns a feedback message to HASS. The node (with id 40) has a child sensor (with id 3) and his of type S_IR and accepts messages with type V_IR_SEND. In HASS this (ms)sensor is defined as a sensor (his identity_id is sensor.ir_remote) and displays the IR code that was sent, but there is no way in HASS to send a given IR code (for instance in automation) to this node... so a service to do that would be nice.

      posted in Home Assistant
      xlcnd
      xlcnd