Skip to content

Monitoring #234

Answered by MisterRadish
MisterRadish asked this question in Q&A
Discussion options

You must be logged in to vote

OK - re-read the documentation and spotted the WireGuard REST API!

What I wanted was an entity for each of my 3 peers (named peer1, peer2, peer3) for the last connection time. Here is my configuration.yaml entry using the RESTful sensor to make a single call to the WireGuard addon and then template sensors to split and format the data.

sensor:
  - platform: rest
    resource: http://a0d7b954-wireguard
    name: "wireguard status"
    unique_id: wireguard_status
    value_template: "OK"
    json_attributes:
      - peer1
      - peer2
      - peer3

template:
  - sensor:
        name: "Wire Guard Peer1 Status"
        unique_id: wireguard_peer1
        state: "{{ as_datetime(state_attr('se…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MisterRadish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant