Add SMART Voltage Monitoring to Fixtures (#1290)

This commit is contained in:
Ryan Nitcher 2024-11-20 10:59:09 -07:00 committed by GitHub
parent 0058ad9f2e
commit 59b047f485
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 193 additions and 145 deletions

View File

@ -262,6 +262,8 @@ class SmartRequest:
"""Get energy usage.""" """Get energy usage."""
return [ return [
SmartRequest("get_energy_usage"), SmartRequest("get_energy_usage"),
SmartRequest("get_emeter_data"),
SmartRequest("get_emeter_vgain_igain"),
SmartRequest.get_raw_request("get_electricity_price_config"), SmartRequest.get_raw_request("get_electricity_price_config"),
] ]

View File

@ -94,7 +94,7 @@
"factory_default": false, "factory_default": false,
"ip": "127.0.0.123", "ip": "127.0.0.123",
"is_support_iot_cloud": true, "is_support_iot_cloud": true,
"mac": "48-22-54-00-00-00", "mac": "78-8C-B5-00-00-00",
"mgt_encrypt_schm": { "mgt_encrypt_schm": {
"encrypt_type": "KLAP", "encrypt_type": "KLAP",
"http_port": 80, "http_port": 80,
@ -127,17 +127,15 @@
"rule_list": [] "rule_list": []
}, },
"get_current_power": { "get_current_power": {
"current_power": 69 "current_power": 1
}, },
"get_device_info": { "get_device_info": {
"auto_off_remain_time": 0, "auto_off_remain_time": 0,
"auto_off_status": "off", "auto_off_status": "off",
"avatar": "coffee_maker", "avatar": "egg_boiler",
"default_states": { "default_states": {
"state": { "state": {},
"on": true "type": "last_states"
},
"type": "custom"
}, },
"device_id": "0000000000000000000000000000000000000000", "device_id": "0000000000000000000000000000000000000000",
"device_on": true, "device_on": true,
@ -150,17 +148,17 @@
"lang": "en_US", "lang": "en_US",
"latitude": 0, "latitude": 0,
"longitude": 0, "longitude": 0,
"mac": "48-22-54-00-00-00", "mac": "78-8C-B5-00-00-00",
"model": "KP125M", "model": "KP125M",
"nickname": "I01BU0tFRF9OQU1FIw==", "nickname": "I01BU0tFRF9OQU1FIw==",
"oem_id": "00000000000000000000000000000000", "oem_id": "00000000000000000000000000000000",
"on_time": 8818511, "on_time": 936394,
"overcurrent_status": "normal", "overcurrent_status": "normal",
"overheat_status": "normal", "overheat_status": "normal",
"power_protection_status": "normal", "power_protection_status": "normal",
"region": "America/Denver", "region": "America/Denver",
"rssi": -40, "rssi": -50,
"signal_level": 3, "signal_level": 2,
"specs": "", "specs": "",
"ssid": "I01BU0tFRF9TU0lEIw==", "ssid": "I01BU0tFRF9TU0lEIw==",
"time_diff": -420, "time_diff": -420,
@ -169,169 +167,179 @@
"get_device_time": { "get_device_time": {
"region": "America/Denver", "region": "America/Denver",
"time_diff": -420, "time_diff": -420,
"timestamp": 1730957712 "timestamp": 1732069933
}, },
"get_device_usage": { "get_device_usage": {
"power_usage": { "power_usage": {
"past30": 46786, "past30": 971,
"past7": 10896, "past7": 442,
"today": 1507 "today": 20
}, },
"saved_power": { "saved_power": {
"past30": 0, "past30": 14896,
"past7": 0, "past7": 9370,
"today": 0 "today": 1152
}, },
"time_usage": { "time_usage": {
"past30": 43175, "past30": 15867,
"past7": 10055, "past7": 9812,
"today": 1355 "today": 1172
} }
}, },
"get_electricity_price_config": { "get_electricity_price_config": {
"constant_price": 0, "constant_price": 0,
"time_of_use_config": { "time_of_use_config": {
"summer": { "summer": {
"midpeak": 120, "midpeak": 0,
"offpeak": 60, "offpeak": 0,
"onpeak": 170, "onpeak": 0,
"period": [ "period": [
5, 0,
1, 0,
10, 0,
31 0
], ],
"weekday_config": [ "weekday_config": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1, 1,
1, 1,
2, 1,
2, 1,
2, 1,
2, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0 1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
], ],
"weekend_config": [ "weekend_config": [
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0 1
] ]
}, },
"winter": { "winter": {
"midpeak": 90, "midpeak": 0,
"offpeak": 60, "offpeak": 0,
"onpeak": 110, "onpeak": 0,
"period": [ "period": [
11, 0,
1, 0,
4, 0,
30 0
], ],
"weekday_config": [ "weekday_config": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1, 1,
1, 1,
2, 1,
2, 1,
2, 1,
2, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0 1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
], ],
"weekend_config": [ "weekend_config": [
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0 1
] ]
} }
}, },
"type": "time_of_use" "type": "constant"
},
"get_emeter_data": {
"current_ma": 33,
"energy_wh": 971,
"power_mw": 1003,
"voltage_mv": 121215
},
"get_emeter_vgain_igain": {
"igain": 10861,
"vgain": 118657
}, },
"get_energy_usage": { "get_energy_usage": {
"current_power": 69737, "current_power": 1003,
"electricity_charge": [ "electricity_charge": [
2901, 0,
3351, 0,
536 0
], ],
"local_time": "2024-11-06 22:35:14", "local_time": "2024-11-19 19:32:14",
"month_energy": 9332, "month_energy": 971,
"month_runtime": 8615, "month_runtime": 15867,
"today_energy": 1507, "today_energy": 20,
"today_runtime": 1355 "today_runtime": 1172
}, },
"get_fw_download_state": { "get_fw_download_state": {
"auto_upgrade": false, "auto_upgrade": false,
@ -358,19 +366,17 @@
"led_rule": "always", "led_rule": "always",
"led_status": true, "led_status": true,
"night_mode": { "night_mode": {
"end_time": 396, "end_time": 420,
"night_mode_type": "sunrise_sunset", "night_mode_type": "custom",
"start_time": 1013, "start_time": 1320
"sunrise_offset": 0,
"sunset_offset": 0
} }
}, },
"get_matter_setup_info": { "get_matter_setup_info": {
"setup_code": "00000000000", "setup_code": "00000000000",
"setup_payload": "00:000000-000000000000" "setup_payload": "00:000000000000-000000"
}, },
"get_max_power": { "get_max_power": {
"max_power": 1537 "max_power": 1542
}, },
"get_next_event": {}, "get_next_event": {},
"get_protection_power": { "get_protection_power": {
@ -434,6 +440,46 @@
"signal_level": 1, "signal_level": 1,
"ssid": "I01BU0tFRF9TU0lEIw==" "ssid": "I01BU0tFRF9TU0lEIw=="
}, },
{
"bssid": "000000000000",
"channel": 0,
"cipher_type": 2,
"key_type": "wpa2_psk",
"signal_level": 1,
"ssid": "I01BU0tFRF9TU0lEIw=="
},
{
"bssid": "000000000000",
"channel": 0,
"cipher_type": 0,
"key_type": "none",
"signal_level": 1,
"ssid": "I01BU0tFRF9TU0lEIw=="
},
{
"bssid": "000000000000",
"channel": 0,
"cipher_type": 2,
"key_type": "wpa2_psk",
"signal_level": 1,
"ssid": "I01BU0tFRF9TU0lEIw=="
},
{
"bssid": "000000000000",
"channel": 0,
"cipher_type": 2,
"key_type": "wpa2_psk",
"signal_level": 1,
"ssid": "I01BU0tFRF9TU0lEIw=="
},
{
"bssid": "000000000000",
"channel": 0,
"cipher_type": 2,
"key_type": "wpa2_psk",
"signal_level": 1,
"ssid": "I01BU0tFRF9TU0lEIw=="
},
{ {
"bssid": "000000000000", "bssid": "000000000000",
"channel": 0, "channel": 0,
@ -444,7 +490,7 @@
} }
], ],
"start_index": 0, "start_index": 0,
"sum": 7, "sum": 12,
"wep_supported": false "wep_supported": false
}, },
"qs_component_nego": { "qs_component_nego": {