Skip to content

Commit

Permalink
Tongou QCB2: expose online_state as a switch rather than sensor
Browse files Browse the repository at this point in the history
From observing the Tuya app's activity, it was seen that despite the
name, this is not just an indication of the connectivity, but is used
to trigger frequent updates of power/current/voltage data when these
are being observed rather than every 10 minutes as the default update
rate on these devices seems to be.

Making this available as a switch allows an automation to regularly
trigger real time updates to keep the data flowing from the device.

Discussion #1483
  • Loading branch information
make-all committed Feb 25, 2024
1 parent 1d26bb1 commit a5ca25f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,21 @@ secondary_entities:
- dps_val: Trip
value: Trip
icon: "mdi:electric-switch"
- entity: binary_sensor
class: connectivity
category: diagnostic
- entity: switch
category: config
name: Live updates
icon: "mdi:chart-bar"
dps:
- id: 109
type: string
name: sensor
name: switch
mapping:
- dps_val: online
value: true
- dps_val: offline
value: false
- value: false
hidden: true
- entity: event
dps:
- id: 110
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,21 @@ secondary_entities:
- dps_val: Trip
value: Trip
icon: "mdi:electric-switch"
- entity: binary_sensor
class: connectivity
category: diagnostic
- entity: switch
category: config
name: Live updates
icon: "mdi:chart-bar"
dps:
- id: 109
type: string
name: sensor
name: switch
mapping:
- dps_val: online
value: true
- dps_val: offline
value: false
- value: false
hidden: true
- entity: event
dps:
- id: 110
Expand Down

0 comments on commit a5ca25f

Please sign in to comment.