2022-02-08 11:43:45 +00:00
""" Tests for the diagnostics data provided by the Plugwise integration. """
from unittest . mock import MagicMock
from aiohttp import ClientSession
from homeassistant . core import HomeAssistant
2022-02-10 19:41:30 +00:00
from tests . common import MockConfigEntry
2022-02-08 11:43:45 +00:00
from tests . components . diagnostics import get_diagnostics_for_config_entry
async def test_diagnostics (
hass : HomeAssistant ,
hass_client : ClientSession ,
mock_smile_adam : MagicMock ,
2022-02-10 19:41:30 +00:00
init_integration : MockConfigEntry ,
) - > None :
2022-02-08 11:43:45 +00:00
""" Test diagnostics. """
2022-02-10 19:41:30 +00:00
assert await get_diagnostics_for_config_entry (
hass , hass_client , init_integration
) == {
2022-02-08 11:43:45 +00:00
" gateway " : {
2022-02-20 19:45:19 +00:00
" smile_name " : " Adam " ,
2022-02-08 11:43:45 +00:00
" gateway_id " : " fe799307f1624099878210aa0b9f1475 " ,
" heater_id " : " 90986d591dcd426cae3ec3e8111ff730 " ,
2022-02-20 19:45:19 +00:00
" cooling_present " : False ,
2022-02-08 11:43:45 +00:00
" notifications " : {
" af82e4ccf9c548528166d38e560662a4 " : {
" warning " : " Node Plug (with MAC address 000D6F000D13CB01, in room ' n.a. ' ) has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device. "
}
} ,
} ,
" devices " : {
" df4a4a8169904cdb9c03d61a21f42140 " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " zone_thermostat " ,
" firmware " : " 2016-10-27T02:00:00+02:00 " ,
" hardware " : " 255 " ,
2022-02-08 11:43:45 +00:00
" location " : " 12493538af164a409c6a1c79e38afe1c " ,
" model " : " Lisa " ,
" name " : " Zone Lisa Bios " ,
2022-05-12 13:19:50 +00:00
" zigbee_mac_address " : " ABCD012345670A06 " ,
2022-02-08 11:43:45 +00:00
" vendor " : " Plugwise " ,
2022-09-26 13:55:29 +00:00
" thermostat " : {
" setpoint " : 13.0 ,
" lower_bound " : 0.0 ,
" upper_bound " : 99.9 ,
" resolution " : 0.01 ,
} ,
2022-10-12 12:48:09 +00:00
" available " : True ,
" preset_modes " : [ " home " , " asleep " , " away " , " vacation " , " no_frost " ] ,
2022-02-08 11:43:45 +00:00
" active_preset " : " away " ,
" available_schedules " : [
" CV Roan " ,
" Bios Schema met Film Avond " ,
" GF7 Woonkamer " ,
" Badkamer Schema " ,
" CV Jessie " ,
] ,
" selected_schedule " : " None " ,
" last_used " : " Badkamer Schema " ,
2022-02-17 16:03:18 +00:00
" mode " : " heat " ,
2022-03-13 18:37:59 +00:00
" sensors " : { " temperature " : 16.5 , " setpoint " : 13.0 , " battery " : 67 } ,
2022-02-08 11:43:45 +00:00
} ,
" b310b72a0e354bfab43089919b9a88bf " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " thermo_sensor " ,
" firmware " : " 2019-03-27T01:00:00+01:00 " ,
" hardware " : " 1 " ,
2022-02-08 11:43:45 +00:00
" location " : " c50f167537524366a5af7aa3942feb1e " ,
" model " : " Tom/Floor " ,
" name " : " Floor kraan " ,
2022-05-12 13:19:50 +00:00
" zigbee_mac_address " : " ABCD012345670A02 " ,
2022-02-08 11:43:45 +00:00
" vendor " : " Plugwise " ,
2022-10-12 12:48:09 +00:00
" available " : True ,
2022-02-08 11:43:45 +00:00
" sensors " : {
" temperature " : 26.0 ,
" setpoint " : 21.5 ,
" temperature_difference " : 3.5 ,
" valve_position " : 100 ,
} ,
} ,
" a2c3583e0a6349358998b760cea82d2a " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " thermo_sensor " ,
" firmware " : " 2019-03-27T01:00:00+01:00 " ,
" hardware " : " 1 " ,
2022-02-08 11:43:45 +00:00
" location " : " 12493538af164a409c6a1c79e38afe1c " ,
" model " : " Tom/Floor " ,
" name " : " Bios Cv Thermostatic Radiator " ,
2022-05-12 13:19:50 +00:00
" zigbee_mac_address " : " ABCD012345670A09 " ,
2022-02-08 11:43:45 +00:00
" vendor " : " Plugwise " ,
2022-10-12 12:48:09 +00:00
" available " : True ,
2022-02-08 11:43:45 +00:00
" sensors " : {
" temperature " : 17.2 ,
2022-03-13 18:37:59 +00:00
" setpoint " : 13.0 ,
2022-02-08 11:43:45 +00:00
" battery " : 62 ,
" temperature_difference " : - 0.2 ,
" valve_position " : 0.0 ,
} ,
} ,
" b59bcebaf94b499ea7d46e4a66fb62d8 " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " zone_thermostat " ,
" firmware " : " 2016-08-02T02:00:00+02:00 " ,
" hardware " : " 255 " ,
2022-02-08 11:43:45 +00:00
" location " : " c50f167537524366a5af7aa3942feb1e " ,
" model " : " Lisa " ,
" name " : " Zone Lisa WK " ,
2022-05-12 13:19:50 +00:00
" zigbee_mac_address " : " ABCD012345670A07 " ,
2022-02-08 11:43:45 +00:00
" vendor " : " Plugwise " ,
2022-09-26 13:55:29 +00:00
" thermostat " : {
" setpoint " : 21.5 ,
" lower_bound " : 0.0 ,
" upper_bound " : 99.9 ,
" resolution " : 0.01 ,
} ,
2022-10-12 12:48:09 +00:00
" available " : True ,
" preset_modes " : [ " home " , " asleep " , " away " , " vacation " , " no_frost " ] ,
2022-02-08 11:43:45 +00:00
" active_preset " : " home " ,
" available_schedules " : [
" CV Roan " ,
" Bios Schema met Film Avond " ,
" GF7 Woonkamer " ,
" Badkamer Schema " ,
" CV Jessie " ,
] ,
" selected_schedule " : " GF7 Woonkamer " ,
" last_used " : " GF7 Woonkamer " ,
" mode " : " auto " ,
" sensors " : { " temperature " : 20.9 , " setpoint " : 21.5 , " battery " : 34 } ,
} ,
" fe799307f1624099878210aa0b9f1475 " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " gateway " ,
" firmware " : " 3.0.15 " ,
" hardware " : " AME Smile 2.0 board " ,
2022-02-08 11:43:45 +00:00
" location " : " 1f9dcf83fd4e4b66b72ff787957bfe5d " ,
2022-02-17 16:03:18 +00:00
" mac_address " : " 012345670001 " ,
2022-10-12 12:48:09 +00:00
" model " : " Gateway " ,
2022-02-08 11:43:45 +00:00
" name " : " Adam " ,
2022-02-17 19:58:06 +00:00
" zigbee_mac_address " : " ABCD012345670101 " ,
2022-10-12 12:48:09 +00:00
" vendor " : " Plugwise " ,
2022-03-30 17:37:05 +00:00
" regulation_mode " : " heating " ,
2022-02-08 11:43:45 +00:00
" binary_sensors " : { " plugwise_notification " : True } ,
" sensors " : { " outdoor_temperature " : 7.81 } ,
} ,
" d3da73bde12a47d5a6b8f9dad971f2ec " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " thermo_sensor " ,
" firmware " : " 2019-03-27T01:00:00+01:00 " ,
" hardware " : " 1 " ,
2022-02-08 11:43:45 +00:00
" location " : " 82fa13f017d240daa0d0ea1775420f24 " ,
" model " : " Tom/Floor " ,
" name " : " Thermostatic Radiator Jessie " ,
2022-05-12 13:19:50 +00:00
" zigbee_mac_address " : " ABCD012345670A10 " ,
2022-02-08 11:43:45 +00:00
" vendor " : " Plugwise " ,
2022-10-12 12:48:09 +00:00
" available " : True ,
2022-02-08 11:43:45 +00:00
" sensors " : {
" temperature " : 17.1 ,
2022-03-13 18:37:59 +00:00
" setpoint " : 15.0 ,
2022-02-08 11:43:45 +00:00
" battery " : 62 ,
" temperature_difference " : 0.1 ,
" valve_position " : 0.0 ,
} ,
} ,
" 21f2b542c49845e6bb416884c55778d6 " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " game_console " ,
" firmware " : " 2019-06-21T02:00:00+02:00 " ,
2022-02-08 11:43:45 +00:00
" location " : " cd143c07248f491493cea0533bc3d669 " ,
" model " : " Plug " ,
" name " : " Playstation Smart Plug " ,
2022-02-17 19:58:06 +00:00
" zigbee_mac_address " : " ABCD012345670A12 " ,
2022-05-12 13:19:50 +00:00
" vendor " : " Plugwise " ,
2022-10-12 12:48:09 +00:00
" available " : True ,
2022-02-08 11:43:45 +00:00
" sensors " : {
" electricity_consumed " : 82.6 ,
" electricity_consumed_interval " : 8.6 ,
" electricity_produced " : 0.0 ,
" electricity_produced_interval " : 0.0 ,
} ,
" switches " : { " relay " : True , " lock " : False } ,
} ,
" 78d1126fc4c743db81b61c20e88342a7 " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " central_heating_pump " ,
" firmware " : " 2019-06-21T02:00:00+02:00 " ,
2022-02-08 11:43:45 +00:00
" location " : " c50f167537524366a5af7aa3942feb1e " ,
" model " : " Plug " ,
" name " : " CV Pomp " ,
2022-02-17 19:58:06 +00:00
" zigbee_mac_address " : " ABCD012345670A05 " ,
2022-05-12 13:19:50 +00:00
" vendor " : " Plugwise " ,
2022-10-12 12:48:09 +00:00
" available " : True ,
2022-02-08 11:43:45 +00:00
" sensors " : {
" electricity_consumed " : 35.6 ,
" electricity_consumed_interval " : 7.37 ,
" electricity_produced " : 0.0 ,
" electricity_produced_interval " : 0.0 ,
} ,
" switches " : { " relay " : True } ,
} ,
" 90986d591dcd426cae3ec3e8111ff730 " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " heater_central " ,
2022-02-08 11:43:45 +00:00
" location " : " 1f9dcf83fd4e4b66b72ff787957bfe5d " ,
" model " : " Unknown " ,
" name " : " OnOff " ,
2022-02-20 19:45:19 +00:00
" binary_sensors " : { " heating_state " : True } ,
2022-02-08 11:43:45 +00:00
" sensors " : {
" water_temperature " : 70.0 ,
" intended_boiler_temperature " : 70.0 ,
" modulation_level " : 1 ,
} ,
} ,
" cd0ddb54ef694e11ac18ed1cbce5dbbd " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " vcr " ,
" firmware " : " 2019-06-21T02:00:00+02:00 " ,
2022-02-08 11:43:45 +00:00
" location " : " cd143c07248f491493cea0533bc3d669 " ,
" model " : " Plug " ,
" name " : " NAS " ,
2022-02-17 19:58:06 +00:00
" zigbee_mac_address " : " ABCD012345670A14 " ,
2022-05-12 13:19:50 +00:00
" vendor " : " Plugwise " ,
2022-10-12 12:48:09 +00:00
" available " : True ,
2022-02-08 11:43:45 +00:00
" sensors " : {
" electricity_consumed " : 16.5 ,
" electricity_consumed_interval " : 0.5 ,
" electricity_produced " : 0.0 ,
" electricity_produced_interval " : 0.0 ,
} ,
" switches " : { " relay " : True , " lock " : True } ,
} ,
" 4a810418d5394b3f82727340b91ba740 " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " router " ,
" firmware " : " 2019-06-21T02:00:00+02:00 " ,
2022-02-08 11:43:45 +00:00
" location " : " cd143c07248f491493cea0533bc3d669 " ,
" model " : " Plug " ,
" name " : " USG Smart Plug " ,
2022-02-17 19:58:06 +00:00
" zigbee_mac_address " : " ABCD012345670A16 " ,
2022-05-12 13:19:50 +00:00
" vendor " : " Plugwise " ,
2022-10-12 12:48:09 +00:00
" available " : True ,
2022-02-08 11:43:45 +00:00
" sensors " : {
" electricity_consumed " : 8.5 ,
" electricity_consumed_interval " : 0.0 ,
" electricity_produced " : 0.0 ,
" electricity_produced_interval " : 0.0 ,
} ,
" switches " : { " relay " : True , " lock " : True } ,
} ,
" 02cf28bfec924855854c544690a609ef " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " vcr " ,
" firmware " : " 2019-06-21T02:00:00+02:00 " ,
2022-02-08 11:43:45 +00:00
" location " : " cd143c07248f491493cea0533bc3d669 " ,
" model " : " Plug " ,
" name " : " NVR " ,
2022-02-17 19:58:06 +00:00
" zigbee_mac_address " : " ABCD012345670A15 " ,
2022-05-12 13:19:50 +00:00
" vendor " : " Plugwise " ,
2022-10-12 12:48:09 +00:00
" available " : True ,
2022-02-08 11:43:45 +00:00
" sensors " : {
" electricity_consumed " : 34.0 ,
" electricity_consumed_interval " : 9.15 ,
" electricity_produced " : 0.0 ,
" electricity_produced_interval " : 0.0 ,
} ,
" switches " : { " relay " : True , " lock " : True } ,
} ,
" a28f588dc4a049a483fd03a30361ad3a " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " settop " ,
" firmware " : " 2019-06-21T02:00:00+02:00 " ,
2022-02-08 11:43:45 +00:00
" location " : " cd143c07248f491493cea0533bc3d669 " ,
" model " : " Plug " ,
" name " : " Fibaro HC2 " ,
2022-02-17 19:58:06 +00:00
" zigbee_mac_address " : " ABCD012345670A13 " ,
2022-05-12 13:19:50 +00:00
" vendor " : " Plugwise " ,
2022-10-12 12:48:09 +00:00
" available " : True ,
2022-02-08 11:43:45 +00:00
" sensors " : {
" electricity_consumed " : 12.5 ,
" electricity_consumed_interval " : 3.8 ,
" electricity_produced " : 0.0 ,
" electricity_produced_interval " : 0.0 ,
} ,
" switches " : { " relay " : True , " lock " : True } ,
} ,
" 6a3bf693d05e48e0b460c815a4fdd09d " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " zone_thermostat " ,
" firmware " : " 2016-10-27T02:00:00+02:00 " ,
" hardware " : " 255 " ,
2022-02-08 11:43:45 +00:00
" location " : " 82fa13f017d240daa0d0ea1775420f24 " ,
" model " : " Lisa " ,
" name " : " Zone Thermostat Jessie " ,
2022-05-12 13:19:50 +00:00
" zigbee_mac_address " : " ABCD012345670A03 " ,
2022-02-08 11:43:45 +00:00
" vendor " : " Plugwise " ,
2022-09-26 13:55:29 +00:00
" thermostat " : {
" setpoint " : 15.0 ,
" lower_bound " : 0.0 ,
" upper_bound " : 99.9 ,
" resolution " : 0.01 ,
} ,
2022-10-12 12:48:09 +00:00
" available " : True ,
" preset_modes " : [ " home " , " asleep " , " away " , " vacation " , " no_frost " ] ,
2022-02-08 11:43:45 +00:00
" active_preset " : " asleep " ,
" available_schedules " : [
" CV Roan " ,
" Bios Schema met Film Avond " ,
" GF7 Woonkamer " ,
" Badkamer Schema " ,
" CV Jessie " ,
] ,
" selected_schedule " : " CV Jessie " ,
" last_used " : " CV Jessie " ,
" mode " : " auto " ,
2022-03-13 18:37:59 +00:00
" sensors " : { " temperature " : 17.2 , " setpoint " : 15.0 , " battery " : 37 } ,
2022-02-08 11:43:45 +00:00
} ,
" 680423ff840043738f42cc7f1ff97a36 " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " thermo_sensor " ,
" firmware " : " 2019-03-27T01:00:00+01:00 " ,
" hardware " : " 1 " ,
2022-02-08 11:43:45 +00:00
" location " : " 08963fec7c53423ca5680aa4cb502c63 " ,
" model " : " Tom/Floor " ,
" name " : " Thermostatic Radiator Badkamer " ,
2022-05-12 13:19:50 +00:00
" zigbee_mac_address " : " ABCD012345670A17 " ,
2022-02-08 11:43:45 +00:00
" vendor " : " Plugwise " ,
2022-10-12 12:48:09 +00:00
" available " : True ,
2022-02-08 11:43:45 +00:00
" sensors " : {
" temperature " : 19.1 ,
2022-03-13 18:37:59 +00:00
" setpoint " : 14.0 ,
2022-02-08 11:43:45 +00:00
" battery " : 51 ,
" temperature_difference " : - 0.4 ,
" valve_position " : 0.0 ,
} ,
} ,
" f1fee6043d3642a9b0a65297455f008e " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " zone_thermostat " ,
" firmware " : " 2016-10-27T02:00:00+02:00 " ,
" hardware " : " 255 " ,
2022-02-08 11:43:45 +00:00
" location " : " 08963fec7c53423ca5680aa4cb502c63 " ,
" model " : " Lisa " ,
" name " : " Zone Thermostat Badkamer " ,
2022-05-12 13:19:50 +00:00
" zigbee_mac_address " : " ABCD012345670A08 " ,
2022-02-08 11:43:45 +00:00
" vendor " : " Plugwise " ,
2022-09-26 13:55:29 +00:00
" thermostat " : {
" setpoint " : 14.0 ,
" lower_bound " : 0.0 ,
" upper_bound " : 99.9 ,
" resolution " : 0.01 ,
} ,
2022-10-12 12:48:09 +00:00
" available " : True ,
" preset_modes " : [ " home " , " asleep " , " away " , " vacation " , " no_frost " ] ,
2022-02-08 11:43:45 +00:00
" active_preset " : " away " ,
" available_schedules " : [
" CV Roan " ,
" Bios Schema met Film Avond " ,
" GF7 Woonkamer " ,
" Badkamer Schema " ,
" CV Jessie " ,
] ,
" selected_schedule " : " Badkamer Schema " ,
" last_used " : " Badkamer Schema " ,
" mode " : " auto " ,
2022-03-13 18:37:59 +00:00
" sensors " : { " temperature " : 18.9 , " setpoint " : 14.0 , " battery " : 92 } ,
2022-02-08 11:43:45 +00:00
} ,
" 675416a629f343c495449970e2ca37b5 " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " router " ,
" firmware " : " 2019-06-21T02:00:00+02:00 " ,
2022-02-08 11:43:45 +00:00
" location " : " cd143c07248f491493cea0533bc3d669 " ,
" model " : " Plug " ,
" name " : " Ziggo Modem " ,
2022-02-17 19:58:06 +00:00
" zigbee_mac_address " : " ABCD012345670A01 " ,
2022-05-12 13:19:50 +00:00
" vendor " : " Plugwise " ,
2022-10-12 12:48:09 +00:00
" available " : True ,
2022-02-08 11:43:45 +00:00
" sensors " : {
" electricity_consumed " : 12.2 ,
" electricity_consumed_interval " : 2.97 ,
" electricity_produced " : 0.0 ,
" electricity_produced_interval " : 0.0 ,
} ,
" switches " : { " relay " : True , " lock " : True } ,
} ,
" e7693eb9582644e5b865dba8d4447cf1 " : {
2022-05-12 13:19:50 +00:00
" dev_class " : " thermostatic_radiator_valve " ,
" firmware " : " 2019-03-27T01:00:00+01:00 " ,
" hardware " : " 1 " ,
2022-02-08 11:43:45 +00:00
" location " : " 446ac08dd04d4eff8ac57489757b7314 " ,
" model " : " Tom/Floor " ,
" name " : " CV Kraan Garage " ,
2022-05-12 13:19:50 +00:00
" zigbee_mac_address " : " ABCD012345670A11 " ,
2022-02-08 11:43:45 +00:00
" vendor " : " Plugwise " ,
2022-09-26 13:55:29 +00:00
" thermostat " : {
" setpoint " : 5.5 ,
" lower_bound " : 0.0 ,
" upper_bound " : 100.0 ,
" resolution " : 0.01 ,
} ,
2022-10-12 12:48:09 +00:00
" available " : True ,
" preset_modes " : [ " home " , " asleep " , " away " , " vacation " , " no_frost " ] ,
2022-02-08 11:43:45 +00:00
" active_preset " : " no_frost " ,
" available_schedules " : [
" CV Roan " ,
" Bios Schema met Film Avond " ,
" GF7 Woonkamer " ,
" Badkamer Schema " ,
" CV Jessie " ,
] ,
" selected_schedule " : " None " ,
" last_used " : " Badkamer Schema " ,
" mode " : " heat " ,
" sensors " : {
" temperature " : 15.6 ,
" setpoint " : 5.5 ,
" battery " : 68 ,
" temperature_difference " : 0.0 ,
" valve_position " : 0.0 ,
} ,
} ,
} ,
}