Trusted networks / auth change question

Anyway here is my final setup for anyone it may help. Note, I am not using the default wirelesstag integration, however, it is useful to setup first since it will automatically configure your URL calling for you on the wireless tag side. Otherwise, you can simply go to the URL Calling modal and set it up yourself.

configuration.yaml:

homeassistant:
  auth_providers:
    - type: homeassistant
    - type: trusted_networks
      trusted_networks:
        - 192.168.4.110
      trusted_users:
        192.168.4.110: !secret wirelesstag_user_id
      allow_bypass_login: true

sensor grow_tent_humidity_state:
  - platform: rest
    name: "Grow Tent Humidity State"
    resource: https://www.mytaglist.com/ethClient.asmx/GetTagList
    method: POST
    scan_interval: 1
    value_template: "{{ value_json.d[0].capEventState }}"
    headers:
      Content-Type: application/json
      Authorization: 'Bearer xxxxx'

sensor grow_tent_temperature_state:
  - platform: rest
    name: "Grow Tent Temperature State"
    resource: https://www.mytaglist.com/ethClient.asmx/GetTagList
    method: POST
    scan_interval: 1
    value_template: "{{ value_json.d[0].tempEventState }}"
    headers:
      Content-Type: application/json
      Authorization: 'Bearer xxxxx'

sensor grow_tent_temperature:
  - platform: rest
    name: "Grow Tent Current Temperature"
    resource: https://www.mytaglist.com/ethClient.asmx/GetTagList
    method: POST
    scan_interval: 1
    value_template: "{{ value_json.d[0].temperature | round(1) }}"
    unit_of_measurement: °C
    headers:
      Content-Type: application/json
      Authorization: 'Bearer xxxxx'

sensor grow_tent_humidity:
  - platform: rest
    name: "Grow Tent Current Humidity"
    resource: https://www.mytaglist.com/ethClient.asmx/GetTagList
    method: POST
    scan_interval: 1
    value_template: "{{ value_json.d[0].cap | round(2) }}"
    unit_of_measurement: "%"
    headers:
      Content-Type: application/json
      Authorization: 'Bearer xxxxx'
  • I followed this post by @Fanta_the_dog to configure HASS as an authorized app in Wireless Tag and to obtain the Bearer auth token.
  • I set up a wireless tag user that is not an admin for trusted_users. This may not be necessary, but I created it as part of troubleshooting and everything works now, so leaving as is.
  • scan_interval has to be set to something lower than 30 (the default), or HASS will be realizing state changes on an up-to 30 second delay.
  • You can figure out your value_template by looking at the response for GetTagList in the Chrome network panel when logged into https://my.wirelesstag.net/eth/index.html -

URL Calling on Wireless Tag side:


Note that the port is not 8123. I get the authentication error notifications if it is.

This should set you up to have Home Assistant toggle devices instantly (i.e. plugs) when Wireless Tag makes a state change. It should also ensure that even if your internet goes down, as long as your local network is running, your wireless tag setup will continue to run.

1 Like

@tube0013 . Thanks you for your article on setting up a proxy to inject auth header. It works like a charm, I set it up running on a windows machine on startup so it runs even on restart of the machine. Also, I am not sure if this integration has since been updated to fix the rest of the wtag URL, the wirelesstags no longer reset the URL to the old value. It now keeps the new values. I have set the url to the proxyIP:proxyport and even after multiple restarts of HA the URL stayed as is.

awesome!

I actually retired my tags. if you want a few PRO ALS sensors let me know, I have 9 of them! dm me on here if interested.