Global Cache IP2CC using Telnet Switch

I just wanted to share this for anyone looking to use the Global Cache IP2CC module from Home Assistant. Using the telnet switch component, it works perfectly. Here’s my config entry:

switch:
  - platform: telnet
    switches:
      ip2cc_relay_1:
        resource: 172.16.4.41
        port: 4998
        command_on: "setstate,1:1,1\r\n"
        command_off: "setstate,1:1,0\r\n"
        command_state: "getstate,1:1\r\n"
        value_template: '{{ value == "state,1:1,1" }}'
      ip2cc_relay_2:
        resource: 172.16.4.41
        port: 4998
        command_on: "setstate,1:2,1\r\n"
        command_off: "setstate,1:2,0\r\n"
        command_state: "getstate,1:2\r\n"
        value_template: '{{ value == "state,1:2,1" }}'
      ip2cc_relay_3:
        resource: 172.16.4.41
        port: 4998
        command_on: "setstate,1:3,1\r\n"
        command_off: "setstate,1:3,0\r\n"
        command_state: "getstate,1:3\r\n"
        value_template: '{{ value == "state,1:3,1" }}'
1 Like

Nice to see they are so secure :slight_smile:

Oh, like as in the lack of authentication? Yeah, you’re correct there. As it’s currently set up, I keep this unit on a separate vlan without exposure to anything outside. You can enable authentication on these devices, but unfortunately there doesn’t seem to be any way to integrate telnet devices with username/passwords into Home Assistant as there are no components/integrations that accommodate this.
I have a WattBox WB-800VPS-IPVM-18 that has non-optional username/password authentication and they only way I’ve found to integrate it is sort of hacky… I used node-red to write a function block that handles the login and authentication stage, then the outputs can be triggered on/off by activating input booleans in Home Assistant. It’s not pretty, but it works!

Works perfectly. Thanks mate this really helped to out.