diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6f3a0fd2a..413f9ab3d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -36,7 +36,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index f144643b6..b5e18ce60 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -4,7 +4,7 @@ name: Latest release env: - CACHE_VERSION: 11 + CACHE_VERSION: 4 DEFAULT_PYTHON: "3.14" # Only run on merges @@ -26,7 +26,7 @@ jobs: if: github.event.pull_request.merged == true steps: - name: Check out committed code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - name: Prepare uv run: | pip install uv @@ -54,6 +54,9 @@ jobs: run: | . venv/bin/activate uv build + - name: Generate PEP 740 Attestations + if: steps.check_package.outputs.should_publish == 'true' + uses: astral-sh/attest-action@f589a42a7efb6fe400b4f400de60b4bc90390027 - name: Publish distribution 📦 to PyPI if: steps.check_package.outputs.should_publish == 'true' run: | diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 512627b10..53843d45a 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -4,7 +4,7 @@ name: Latest commit env: - CACHE_VERSION: 3 + CACHE_VERSION: 4 DEFAULT_PYTHON: "3.14" VENV: venv @@ -25,10 +25,10 @@ jobs: python-version: ${{ steps.python.outputs.python-version }} # Ensure all runners use THIS minor version steps: - name: Check out committed code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - name: Set up Python and determine minor version for ${{ env.DEFAULT_PYTHON }} id: python - uses: actions/setup-python@v6 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Fetch HA pyproject @@ -46,7 +46,7 @@ jobs: steps: - name: Prepare code checkout and python/prek(pre-commit) setup id: cache-reuse - uses: plugwise/gh-actions/prepare-python-and-code@v2 + uses: plugwise/gh-actions/prepare-python-and-code@9054f02b05e53697300c41df27d0307332dc7cd8 with: cache-key: ${{ needs.cache.outputs.cache-key }} fail-on-miss: false # First time create cache (if not already exists) @@ -62,12 +62,12 @@ jobs: - prepare steps: - name: Check out committed code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 with: persist-credentials: false - name: Restore cached environment id: cache-reuse - uses: plugwise/gh-actions/restore-venv@v2 + uses: plugwise/gh-actions/restore-venv@9054f02b05e53697300c41df27d0307332dc7cd8 with: cache-key: ${{ needs.cache.outputs.cache-key }} python-version: ${{ needs.cache.outputs.python-version }} @@ -96,14 +96,14 @@ jobs: - cache - prepare - ruff - - shellcheck + - checks - dependencies_check steps: - name: Check out committed code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - name: Restore cached environment id: cache-reuse - uses: plugwise/gh-actions/restore-venv@v2 + uses: plugwise/gh-actions/restore-venv@9054f02b05e53697300c41df27d0307332dc7cd8 with: cache-key: ${{ needs.cache.outputs.cache-key }} python-version: ${{ needs.cache.outputs.python-version }} @@ -130,15 +130,15 @@ jobs: python-version: ["3.14", "3.13"] steps: - name: Check out committed code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - name: Set up Python ${{ matrix.python-version }} id: python - uses: actions/setup-python@v6 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 with: python-version: ${{ matrix.python-version }} - name: Restore cached environment id: cache-reuse - uses: plugwise/gh-actions/restore-venv@v2 + uses: plugwise/gh-actions/restore-venv@9054f02b05e53697300c41df27d0307332dc7cd8 with: fail-on-miss: false # First time create cache (if not already exists) cache-key: ${{ needs.cache.outputs.cache-key }} @@ -150,7 +150,7 @@ jobs: . venv-${{ steps.python.outputs.python-version }}/bin/activate pytest --log-level info tests/*.py --cov='.' - name: Upload coverage artifact - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a with: name: coverage-${{ steps.python.outputs.python-version }} path: .coverage @@ -166,12 +166,12 @@ jobs: - pytest steps: - name: Check out committed code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 with: persist-credentials: false - name: Restore cached environment id: cache-reuse - uses: plugwise/gh-actions/restore-venv@v2 + uses: plugwise/gh-actions/restore-venv@9054f02b05e53697300c41df27d0307332dc7cd8 with: cache-key: ${{ needs.cache.outputs.cache-key }} python-version: ${{ needs.cache.outputs.python-version }} @@ -183,15 +183,23 @@ jobs: pip list | grep -i mypy mypy plugwise/ - # Check shellscripts - shellcheck: - name: Shellcheck + # Check shellscripts and core requirements + checks: + name: Check shellscrips and core dependencies runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Check out committed code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + persist-credentials: false - name: Run ShellCheck - uses: ludeeus/action-shellcheck@master + uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 + - name: Check against HA Core release + uses: chemelli74/ha-core-dependency-check/release@7788df2ecd810988a459b20e599bb8c975dd7a3a # v1.3.0 + - name: Check against HA Core dev + uses: chemelli74/ha-core-dependency-check/dev@7788df2ecd810988a459b20e599bb8c975dd7a3a # v1.3.0 # Check for missing python dependencies dependencies_check: @@ -199,7 +207,7 @@ jobs: name: Dependency steps: - name: Check out committed code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - name: Run dependency checker run: scripts/dependencies_check.sh debug @@ -213,17 +221,17 @@ jobs: - mypy steps: - name: Check out committed code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - name: Restore cached environment id: cache-reuse - uses: plugwise/gh-actions/restore-venv@v2 + uses: plugwise/gh-actions/restore-venv@9054f02b05e53697300c41df27d0307332dc7cd8 with: cache-key: ${{ needs.cache.outputs.cache-key }} python-version: ${{ needs.cache.outputs.python-version }} venv-dir: ${{ env.VENV }} prek-home: ${{ env.PREK_HOME }} - name: Download all coverage artifacts - uses: actions/download-artifact@v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c with: pattern: coverage-* merge-multiple: true @@ -235,7 +243,7 @@ jobs: coverage report --fail-under=94 coverage xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v6 + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -253,7 +261,7 @@ jobs: - mypy steps: - name: Check out committed code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - name: Prepare uv run: | pip install uv @@ -280,6 +288,9 @@ jobs: run: | . venv/bin/activate uv build + - name: Generate PEP 740 Attestations + if: steps.check_package.outputs.should_publish == 'true' + uses: astral-sh/attest-action@f589a42a7efb6fe400b4f400de60b4bc90390027 - name: Publish distribution 📦 to TestPyPI if: steps.check_package.outputs.should_publish == 'true' run: | @@ -295,10 +306,10 @@ jobs: - coverage steps: - name: Check out committed code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - name: Restore cached environment id: cache-reuse - uses: plugwise/gh-actions/restore-venv@v2 + uses: plugwise/gh-actions/restore-venv@9054f02b05e53697300c41df27d0307332dc7cd8 with: cache-key: ${{ needs.cache.outputs.cache-key }} python-version: ${{ needs.cache.outputs.python-version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ee4300a3..f88c7c3cd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ default_language_version: repos: # Run manually in CI skipping the branch checks - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.8 + rev: v0.17.3 hooks: - id: ruff name: "Ruff check" @@ -24,13 +24,13 @@ repos: args: - --branch=main - repo: https://github.com/asottile/pyupgrade - rev: v3.21.2 + rev: v3.22.0 hooks: - id: pyupgrade name: "Check Py upgrade" args: [--py311-plus] - repo: https://github.com/codespell-project/codespell - rev: v2.4.2 + rev: v2.4.3 hooks: - id: codespell name: "Check Code Spelling" @@ -56,14 +56,14 @@ repos: - id: yamllint name: "YAML linting" - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.10.0.1 + rev: v0.11.0.1-1 hooks: - id: shellcheck name: "Shell checking" args: - --external-sources - repo: https://github.com/cdce8p/python-typing-update - rev: v0.8.1 + rev: v0.9.0 hooks: # Run `python-typing-update` hook manually from time to time # to update python typing syntax. @@ -112,7 +112,7 @@ repos: language: script pass_filenames: false - repo: https://github.com/jackdewinter/pymarkdown - rev: v0.9.36 + rev: v0.9.41 hooks: - id: pymarkdown name: MarkDown Lint diff --git a/CHANGELOG.md b/CHANGELOG.md index 20ec7a66b..41fdef5f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,79 @@ # Changelog -## Ongoing +## v1.16.0 -- Add Add missing Emma firmware via PR [#863](https://github.com/plugwise/python-plugwise/pull/863) +- Contribution PR [#940](https://github.com/plugwise/python-plugwise/pull/940) by @MartvanMale: + - A zone shows the cooling setpoint of each preset only when the gateway has cooling and cooling is allowed for that zone. A zone that may not cool shows the heating setpoint alone, and, when no schedule is selected, reports heating as its climate mode. + - Setting the heating setpoint of a preset no longer fails in a zone that may not cool when the value is above the cooling setpoint stored for that zone. + +## v1.15.0 + +- Contribution PR's [#936](https://github.com/plugwise/python-plugwise/pull/936) and [#938](https://github.com/plugwise/python-plugwise/pull/938) by @MartvanMale: + - Add the heating setpoint of each preset as an adjustable value for every zone with its own preset rule, and the cooling setpoint when the gateway has cooling. Changing one resets a manual setpoint on that zone to its active preset. + - Each Adam zone now takes its presets from its own preset rule, not from the last preset rule on the gateway. + - Fix setting changes after a timeout or a 504 error. The retry sent a read instead of the change, so the change was reported as done even when the gateway never got it. + +## v1.14.8 + +- Fix for issue [#933](https://github.com/plugwise/python-plugwise/issues/933) via PR [#934](https://github.com/plugwise/python-plugwise/pull/934) +- Declare `packaging` as a dependency; `import plugwise` failed on a clean install without it + +## v1.14.7 + +- Adapt to percentages being shown as 0-100 instead of 0-1, solving Issue [#903](https://github.com/plugwise/python-plugwise/issues/903) +- Collect wifi_mac_address [#904](https://github.com/plugwise/python-plugwise/issues/904) + +## v1.14.6 + +- Bugfixes: fix domestic hot water comfort switching, dhw modes selection issues reported in Core issue [#178699](https://github.com/home-assistant/core/issues/178699) via PR [#914](https://github.com/plugwise/python-plugwise/pull/914) + +## v1.14.5 + +- Rename dict-keys: `max_dhw_temperature` to `dhw_temperature`, `maximum_boiler_temperature` to `boiler_temperature` via PR [#908](https://github.com/plugwise/python-plugwise/pull/908) + +## v1.14.4 + +- Correct typing of select_schedule, manual fixture update + +## v1.14.3 + +- Change representation of no-thermostat-schedule-defined to a single `off` option via PR [#899](https://github.com/plugwise/python-plugwise/pull/899) + +## v1.14.2 + +- Implement common typing in functions that are interacting. + +## v1.14.1 + +- Improve manual fixtures script, reorder set_schedule_state() arguments for better compatibility with set_dhw_mode(), via PR[#897](https://github.com/plugwise/python-plugwise/pull/897) + +## v1.14.0 + +- Include both old and new entities for a step-wise introduction of water_heaters in HA via PR [#895](https://github.com/plugwise/python-plugwise/pull/895): + - Keep the `dhw_cm_switch` and add the `dhw_modes list` and the `select_dhw_mode` string that will replace the `dhw_cm_switch` in the future + - `dhw_cm_switch` = `on` --> `select_dhw_mode` = `comfort`, `dhw_cm_switch` = `off` --> `select_dhw_mode` = `eco` + - Add a `current` (`temperature`) key to the `maximum_boiler_temperature` and `max_dhw_temperature` dicts + +## v1.13.1 + +- Implement dedicated boiler_temperature dict for legacy Anna via PR [#893](https://github.com/plugwise/python-plugwise/pull/893) + +## v1.13.0 + +- Improve on v1.12.0 update by outputting dedicated boiler_ and dhw_temperature dicts with current-key added. Rename dhw_mode off to eco for standard cv-heaters. + Via PR [#888](https://github.com/plugwise/python-plugwise/pull/888) +- Add PEP 740 digital attestations (workaround until included in `uv publish`), pin GitHub acions including our own from gh-actions, via PR [#891](https://github.com/plugwise/python-plugwise/pull/891) +- Solve aiohttp BasicAuth deprecation via PR [#890](https://github.com/plugwise/python-plugwise/pull/890) + +## v1.12.0 + +- Replace the DHW-comfort-mode switch by a DHW mode selector to match the new HA select or water_heater platform updates, via PR [#883](https://github.com/plugwise/python-plugwise/pull/883) + +## v1.11.4 + +- Correct Anna P1 detection via PR [#879](https://github.com/plugwise/python-plugwise/pull/879) +- Create an extra test-fixture for increased test coverage in the Integration via PR [#878](https://github.com/plugwise/python-plugwise/pull/878) +- Add missing Emma firmware via PR [#863](https://github.com/plugwise/python-plugwise/pull/863) - Improve test function added in #860 via PR [#862](https://github.com/plugwise/python-plugwise/pull/862) ## v1.11.3 diff --git a/Q&Dtesting/test_adam.py b/Q&Dtesting/test_adam.py new file mode 100644 index 000000000..21d599bcd --- /dev/null +++ b/Q&Dtesting/test_adam.py @@ -0,0 +1,125 @@ +"""Test Plugwise module Adam related functionality.""" + +import pytest + +from .test_init import TestPlugwise + +SMILE_TYPE = "adam" + +# Reoccuring constants +BADKAMER_SCHEMA = "Badkamer Schema" +CV_JESSIE = "CV Jessie" +GF7_WOONKAMER = "GF7 Woonkamer" +WERKDAG_SCHEMA = "Werkdag schema" + + +class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outside-init + """Tests for Adam.""" + + @pytest.mark.asyncio + async def test_connect_adam_bad_thermostat(self, caplog): + """Test Adam with missing thermostat data.""" + self.smile_setup = "adam_bad_thermostat" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper(raise_timeout=True) + await self.device_test(api, "2023-12-17 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_adam_plus_anna_new(self): + """Test extended Adam (firmware 3.9) with Anna, Emma, Jip, and a switch-group setup.""" + self.smile_setup = "adam_plus_anna_new" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2025-10-12 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_adam_plus_anna_new_regulation_off(self): + """Test regultaion_mode off with control_state key missing for Adam.""" + self.smile_setup = "adam_plus_anna_new_regulation_off" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2023-12-17 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_adam_zone_per_device(self): + """Test an extensive setup of Adam with a zone per device.""" + self.smile_setup = "adam_zone_per_device" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-05-16 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_adam_multiple_devices_per_zone(self): + """Test an extensive setup of Adam with multiple devices per zone.""" + self.smile_setup = "adam_multiple_devices_per_zone" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-05-16 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_adam_heatpump_cooling(self): + """Test Adam with heatpump in cooling mode and idle.""" + self.smile_setup = "adam_heatpump_cooling" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-01-02 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_adam_onoff_cooling_fake_firmware(self): + """Test an Adam with a fake OnOff cooling device in cooling mode.""" + self.smile_setup = "adam_onoff_cooling_fake_firmware" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-01-02 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_adam_plus_anna(self): + """Test Adam (firmware 3.0) with Anna setup.""" + self.smile_setup = "adam_plus_anna" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2020-03-22 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_adam_plus_jip(self): + """Test Adam with Jip setup.""" + self.smile_setup = "adam_jip" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2021-06-20 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) diff --git a/Q&Dtesting/test_anna.py b/Q&Dtesting/test_anna.py new file mode 100644 index 000000000..7e1b3a180 --- /dev/null +++ b/Q&Dtesting/test_anna.py @@ -0,0 +1,223 @@ +"""Test Plugwise module Anna related functionality.""" + +import pytest + +from .test_init import TestPlugwise + +SMILE_TYPE = "anna" +# Reoccuring constants +THERMOSTAT_SCHEDULE = "Thermostat schedule" + + +class TestPlugwiseAnna(TestPlugwise): # pylint: disable=attribute-defined-outside-init + """Tests for Anna standalone, i.e. not combined with Adam.""" + + @pytest.mark.asyncio + async def test_connect_anna_v4(self): + """Test an Anna firmware 4 setup.""" + self.smile_setup = "anna_v4" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2020-04-05 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_v4_dhw(self): + """Test an Anna firmware 4 setup for domestic hot water.""" + self.smile_setup = "anna_v4_dhw" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2020-04-05 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_v4_no_tag(self): + """Test an Anna firmware 4 setup - missing tag (issue).""" + self.smile_setup = "anna_v4_no_tag" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2020-04-05 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_without_boiler_fw441(self): + """Test an Anna with firmware 4.4, without a boiler.""" + self.smile_setup = "anna_without_boiler_fw441" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-05-16 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_heatpump_heating(self): + """Test an Anna with Elga, cooling-mode off, in heating mode.""" + + self.smile_setup = "anna_heatpump_heating" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2020-04-12 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_heatpump_cooling(self): + """Test an Anna with Elga setup in cooling mode. + + This test also covers the situation that the operation-mode it switched + from heating to cooling due to the outdoor temperature rising above the + cooling_activation_outdoor_temperature threshold. + """ + self.smile_setup = "anna_heatpump_cooling" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2020-04-19 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_heatpump_cooling_fake_firmware(self): + """Test an Anna with a fake Loria/Thermastate setup in cooling mode. + + The Anna + Elga firmware has been amended with the point_log cooling_enabled and + gateway/features/cooling keys. + This test also covers the situation that the operation-mode it switched + from heating to cooling due to the outdoor temperature rising above the + cooling_activation_outdoor_temperature threshold. + """ + self.smile_setup = "anna_heatpump_cooling_fake_firmware" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2020-04-19 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_elga_no_cooling(self): + """Test an Anna with Elga, cooling-mode not used, in heating mode.""" + + self.smile_setup = "anna_elga_no_cooling" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2020-04-12 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_elga_2(self): + """Test a 2nd Anna with Elga setup, cooling off, in idle mode (with missing outdoor temperature - solved).""" + self.smile_setup = "anna_elga_2" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-03-13 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_elga_2_schedule_off(self): + """Test Anna with Elga setup, cooling off, in idle mode, modified to schedule off.""" + self.smile_setup = "anna_elga_2_schedule_off" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-03-13 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_elga_2_cooling(self): + """Test a 2nd Anna with Elga setup with cooling active. + + This testcase also covers testing of the generation of a cooling-based + schedule, opposite the generation of a heating-based schedule. + """ + self.smile_setup = "anna_elga_2_cooling" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-03-10 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_loria_heating_idle(self): + """Test an Anna with a Loria in heating mode - state idle.""" + self.smile_setup = "anna_loria_heating_idle" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-05-16 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_loria_cooling_active(self): + """Test an Anna with a Loria in heating mode - state idle.""" + self.smile_setup = "anna_loria_cooling_active" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-05-16 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_loria_driessens(self): + """Test an Anna with a Loria in heating mode - state idle.""" + self.smile_setup = "anna_loria_driessens" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-05-16 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_p1(self): + """Test an Anna v4 connected to a P1 port.""" + self.smile_setup = "anna_p1" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2025-11-02 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_anna_v4_no_modules(self): + """Test an Anna v4 with removed Anna and OpenTherm device.""" + self.smile_setup = "anna_v4_no_modules" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-05-16 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) diff --git a/Q&Dtesting/test_p1.py b/Q&Dtesting/test_p1.py new file mode 100644 index 000000000..39cb1be0f --- /dev/null +++ b/Q&Dtesting/test_p1.py @@ -0,0 +1,35 @@ +"""Test Plugwise module P1 related functionality.""" + +import pytest + +from .test_init import TestPlugwise + +SMILE_TYPE = "p1" + + +class TestPlugwiseP1(TestPlugwise): # pylint: disable=attribute-defined-outside-init + """Tests for P1.""" + + @pytest.mark.asyncio + async def test_connect_p1v4_442_single(self): + """Test a P1 firmware 4.4 single-phase setup.""" + self.smile_setup = "p1v4_442_single" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-05-16 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) + + @pytest.mark.asyncio + async def test_connect_p1v4_442_triple(self): + """Test a P1 firmware 4 3-phase setup.""" + self.smile_setup = "p1v4_442_triple" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + await self.device_test(api, "2022-05-16 00:00:01", testdata) + + await api.close_connection() + await self.disconnect(server, client) diff --git a/fixtures/adam_bad_thermostat/data.json b/fixtures/adam_bad_thermostat/data.json index 5554c02e1..3b801e109 100644 --- a/fixtures/adam_bad_thermostat/data.json +++ b/fixtures/adam_bad_thermostat/data.json @@ -6,27 +6,34 @@ "flame_state": false, "heating_state": false }, + "boiler_temperature": { + "current": 20.9, + "lower_bound": 25.0, + "resolution": 0.01, + "setpoint": 38.0, + "upper_bound": 45.0 + }, "dev_class": "heater_central", - "location": "856285a783f24bf4b2573c8bc510eabf", - "max_dhw_temperature": { + "dhw_mode": "eco", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 49.9, "lower_bound": 0.0, "resolution": 1.0, "setpoint": 50.0, "upper_bound": 100.0 }, - "maximum_boiler_temperature": { - "lower_bound": 25.0, - "resolution": 0.01, - "setpoint": 38.0, - "upper_bound": 45.0 - }, + "location": "856285a783f24bf4b2573c8bc510eabf", "model": "Generic heater", "model_id": "1.1", "name": "OpenTherm", "sensors": { "dhw_temperature": 49.9, "intended_boiler_temperature": 0.0, - "modulation_level": 0.0, + "modulation_level": 0, "outdoor_air_temperature": 13.6, "return_temperature": 33.0, "water_temperature": 20.9 @@ -38,12 +45,38 @@ }, "3ee6b9486cb04c258a3130fff2b144a4": { "active_preset": "home", - "available_schedules": [], + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, + "available_schedules": [ + "off" + ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Overloop", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", "asleep", @@ -51,7 +84,7 @@ "vacation", "no_frost" ], - "select_schedule": null, + "select_schedule": "off", "sensors": { "temperature": 20.3 }, @@ -61,6 +94,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "8edf4c8b659342e8ae9809a6f9734532": { @@ -130,6 +169,7 @@ "outdoor_temperature": 15.6 }, "vendor": "Plugwise", + "wifi_mac_address": "C493004A803C", "zigbee_mac_address": "000D6F000DB9F188" } } diff --git a/fixtures/adam_heatpump_cooling/data.json b/fixtures/adam_heatpump_cooling/data.json index 4075bf756..f8f13e5c0 100644 --- a/fixtures/adam_heatpump_cooling/data.json +++ b/fixtures/adam_heatpump_cooling/data.json @@ -1,23 +1,51 @@ { "04b15f6e884448288f811d29fb7b1b30": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 18.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Opstaan weekdag", "Werkdag schema", - "Weekend", - "off" + "Weekend" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 18.5, + "upper_bound": 30.0 + }, "climate_mode": "cool", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 19.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Slaapkamer SJ", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "vacation", "away", - "home", - "asleep" + "asleep", + "home" ], "select_schedule": "off", "select_zone_profile": "passive", @@ -38,6 +66,13 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 16.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -54,27 +89,34 @@ "flame_state": false, "heating_state": false }, + "boiler_temperature": { + "current": 24.5, + "lower_bound": 7.0, + "resolution": 0.01, + "setpoint": 35.0, + "upper_bound": 50.0 + }, "dev_class": "heater_central", - "location": "eedadcb297564f1483faa509179aebed", - "max_dhw_temperature": { + "dhw_mode": "comfort", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 63.5, "lower_bound": 40.0, "resolution": 0.01, "setpoint": 60.0, "upper_bound": 65.0 }, - "maximum_boiler_temperature": { - "lower_bound": 7.0, - "resolution": 0.01, - "setpoint": 35.0, - "upper_bound": 50.0 - }, + "location": "eedadcb297564f1483faa509179aebed", "model": "Generic heater/cooler", "model_id": "17.1", "name": "OpenTherm", "sensors": { "dhw_temperature": 63.5, "intended_boiler_temperature": 0.0, - "modulation_level": 0.0, + "modulation_level": 0, "outdoor_air_temperature": 13.5, "return_temperature": 24.9, "water_pressure": 2.0, @@ -133,17 +175,41 @@ }, "20e735858f8146cead98b873177a4f99": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Opstaan weekdag", "Werkdag schema", - "Weekend", - "off" + "Weekend" ], - "climate_mode": "cool", + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.5, + "upper_bound": 30.0 + }, + "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Slaapkamer DB", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "vacation", @@ -170,6 +236,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 16.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -261,23 +333,47 @@ }, "5cc21042f87f4b4c94ccb5537c47a53f": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.5, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Opstaan weekdag", "Werkdag schema", - "Weekend", - "off" + "Weekend" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.5, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.5, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Badkamer 2", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "vacation", - "away", "home", - "asleep" + "asleep", + "away" ], "select_schedule": "Werkdag schema", "select_zone_profile": "passive", @@ -297,6 +393,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 16.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -421,23 +523,47 @@ }, "8cf650a4c10c44819e426bed406aec34": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.5, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Opstaan weekdag", "Werkdag schema", - "Weekend", - "off" + "Weekend" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.5, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.5, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Badkamer 1", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "vacation", - "away", "home", - "asleep" + "asleep", + "away" ], "select_schedule": "Werkdag schema", "select_zone_profile": "passive", @@ -458,6 +584,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 16.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -467,23 +599,47 @@ }, "93ac3f7bf25342f58cbb77c4a99ac0b3": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Opstaan weekdag", "Werkdag schema", - "Weekend", - "off" + "Weekend" ], - "climate_mode": "cool", + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.5, + "upper_bound": 30.0 + }, + "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Slaapkamer RB", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "vacation", "away", - "home", - "asleep" + "asleep", + "home" ], "select_schedule": "off", "select_zone_profile": "passive", @@ -503,6 +659,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 16.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -532,22 +694,50 @@ }, "9a27714b970547ee9a6bdadc2b815ad5": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 18.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Opstaan weekdag", "Werkdag schema", - "Weekend", - "off" + "Weekend" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 18.5, + "upper_bound": 30.0 + }, "climate_mode": "cool", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 18.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Slaapkamer SQ", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "vacation", - "away", "home", + "away", "asleep" ], "select_schedule": "off", @@ -569,6 +759,13 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 16.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -598,17 +795,45 @@ }, "a562019b0b1f47a4bde8ebe3dbe3e8a9": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 21.5, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Opstaan weekdag", "Werkdag schema", - "Weekend", - "off" + "Weekend" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 21.5, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 21.5, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Keuken", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "vacation", @@ -635,6 +860,13 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 16.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -644,23 +876,47 @@ }, "b52908550469425b812c87f766fe5303": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.5, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Opstaan weekdag", "Werkdag schema", - "Weekend", - "off" + "Weekend" ], - "climate_mode": "cool", + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.0, + "upper_bound": 30.0 + }, + "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Bijkeuken", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "vacation", + "asleep", "away", - "home", - "asleep" + "home" ], "select_schedule": "off", "select_zone_profile": "active", @@ -681,6 +937,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 16.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -788,22 +1050,46 @@ }, "e39529c79ab54fda9bed26cfc0447546": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.5, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Opstaan weekdag", "Werkdag schema", - "Weekend", - "off" + "Weekend" ], - "climate_mode": "cool", + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.5, + "upper_bound": 30.0 + }, + "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.5, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Slaapkamer JM", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "vacation", - "away", "home", + "away", "asleep" ], "select_schedule": "off", @@ -825,6 +1111,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 16.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -904,17 +1196,45 @@ }, "fa5fa6b34f6b40a0972988b20e888ed4": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 21.5, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Opstaan weekdag", "Werkdag schema", - "Weekend", - "off" + "Weekend" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 21.5, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 21.5, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Woonkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "vacation", @@ -941,6 +1261,13 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 16.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", diff --git a/fixtures/adam_jip/data.json b/fixtures/adam_jip/data.json index 65d256e10..3ec32adf8 100644 --- a/fixtures/adam_jip/data.json +++ b/fixtures/adam_jip/data.json @@ -1,20 +1,46 @@ { "06aecb3d00354375924f50c47af36bd2": { "active_preset": "no_frost", - "available_schedules": [], + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, + "available_schedules": [ + "off" + ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Slaapkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 9.0, + "upper_bound": 30.0 + }, "preset_modes": [ + "vacation", + "no_frost", "home", - "asleep", "away", - "vacation", - "no_frost" + "asleep" ], - "select_schedule": null, + "select_schedule": "off", "select_zone_profile": "active", "sensors": { "temperature": 24.2 @@ -33,6 +59,12 @@ "356b65335e274d769c338223e7af9c33" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -42,12 +74,38 @@ }, "13228dab8ce04617af318a2888b3c548": { "active_preset": "home", - "available_schedules": [], + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, + "available_schedules": [ + "off" + ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Woonkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", "asleep", @@ -55,7 +113,7 @@ "vacation", "no_frost" ], - "select_schedule": null, + "select_schedule": "off", "select_zone_profile": "active", "sensors": { "temperature": 27.4 @@ -74,6 +132,12 @@ "833de10f269c4deab58fb9df69901b4e" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -120,7 +184,7 @@ "setpoint": 13.0, "temperature": 28.8, "temperature_difference": 2.0, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -144,7 +208,7 @@ "setpoint": 13.0, "temperature": 24.2, "temperature_difference": 1.7, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -282,20 +346,46 @@ }, "d27aede973b54be484f6842d1b2802ad": { "active_preset": "home", - "available_schedules": [], + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, + "available_schedules": [ + "off" + ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Kinderkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 9.0, + "upper_bound": 30.0 + }, "preset_modes": [ + "vacation", + "no_frost", "home", - "asleep", "away", - "vacation", - "no_frost" + "asleep" ], - "select_schedule": null, + "select_schedule": "off", "select_zone_profile": "active", "sensors": { "temperature": 30.0 @@ -314,6 +404,12 @@ "d4496250d0e942cfa7aea3476e9070d5" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -334,7 +430,7 @@ "setpoint": 13.0, "temperature": 28.7, "temperature_difference": 1.9, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -347,20 +443,46 @@ }, "d58fec52899f4f1c92e4f8fad6d8c48c": { "active_preset": "home", - "available_schedules": [], + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, + "available_schedules": [ + "off" + ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Logeerkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 9.0, + "upper_bound": 30.0 + }, "preset_modes": [ + "vacation", + "no_frost", "home", - "asleep", "away", - "vacation", - "no_frost" + "asleep" ], - "select_schedule": null, + "select_schedule": "off", "select_zone_profile": "active", "sensors": { "temperature": 30.0 @@ -379,6 +501,12 @@ "1da4d325838e4ad8aac12177214505c9" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -393,26 +521,33 @@ "flame_state": false, "heating_state": false }, + "boiler_temperature": { + "current": 37.3, + "lower_bound": 20.0, + "resolution": 0.01, + "setpoint": 90.0, + "upper_bound": 90.0 + }, "dev_class": "heater_central", - "location": "9e4433a9d69f40b3aefd15e74395eaec", - "max_dhw_temperature": { + "dhw_mode": "eco", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 37.3, "lower_bound": 40.0, "resolution": 0.01, "setpoint": 60.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 20.0, - "resolution": 0.01, - "setpoint": 90.0, - "upper_bound": 90.0 - }, + "location": "9e4433a9d69f40b3aefd15e74395eaec", "model": "Generic heater", "model_id": "10.20", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 0.0, - "modulation_level": 0.0, + "modulation_level": 0, "return_temperature": 37.1, "water_pressure": 1.4, "water_temperature": 37.3 diff --git a/fixtures/adam_multiple_devices_per_zone/data.json b/fixtures/adam_multiple_devices_per_zone/data.json index e69575991..44d307e86 100644 --- a/fixtures/adam_multiple_devices_per_zone/data.json +++ b/fixtures/adam_multiple_devices_per_zone/data.json @@ -22,25 +22,49 @@ }, "08963fec7c53423ca5680aa4cb502c63": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 14.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 21.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Badkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ - "home", "asleep", + "no_frost", "away", - "vacation", - "no_frost" + "home", + "vacation" ], "select_schedule": "Badkamer Schema", "sensors": { @@ -59,29 +83,59 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "12493538af164a409c6a1c79e38afe1c": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Bios", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 8.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", - "asleep", "away", "vacation", - "no_frost" + "no_frost", + "asleep" ], "select_schedule": "off", "sensors": { @@ -103,6 +157,12 @@ "a2c3583e0a6349358998b760cea82d2a" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "21f2b542c49845e6bb416884c55778d6": { @@ -128,19 +188,43 @@ }, "446ac08dd04d4eff8ac57489757b7314": { "active_preset": "no_frost", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Garage", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", "asleep", @@ -164,6 +248,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "4a810418d5394b3f82727340b91ba740": { @@ -225,7 +315,7 @@ "setpoint": 14.0, "temperature": 19.1, "temperature_difference": -0.4, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -284,25 +374,49 @@ }, "82fa13f017d240daa0d0ea1775420f24": { "active_preset": "asleep", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 16.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Jessie", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", - "asleep", + "no_frost", "away", "vacation", - "no_frost" + "asleep" ], "select_schedule": "CV Jessie", "sensors": { @@ -322,6 +436,12 @@ "d3da73bde12a47d5a6b8f9dad971f2ec" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 11.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "90986d591dcd426cae3ec3e8111ff730": { @@ -376,7 +496,7 @@ "setpoint": 13.0, "temperature": 17.2, "temperature_difference": -0.2, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -439,25 +559,49 @@ }, "c50f167537524366a5af7aa3942feb1e": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "heating", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 21.5, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Woonkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "preset_modes": [ - "home", + "vacation", "asleep", + "no_frost", "away", - "vacation", - "no_frost" + "home" ], "select_schedule": "GF7 Woonkamer", "sensors": { @@ -479,6 +623,12 @@ "b310b72a0e354bfab43089919b9a88bf" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "cd0ddb54ef694e11ac18ed1cbce5dbbd": { @@ -519,7 +669,7 @@ "setpoint": 15.0, "temperature": 17.1, "temperature_difference": 0.1, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -587,7 +737,7 @@ "setpoint": 5.5, "temperature": 15.6, "temperature_difference": 0.0, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, diff --git a/fixtures/adam_onoff_cooling_fake_firmware/data.json b/fixtures/adam_onoff_cooling_fake_firmware/data.json index 117954c61..a81284da4 100644 --- a/fixtures/adam_onoff_cooling_fake_firmware/data.json +++ b/fixtures/adam_onoff_cooling_fake_firmware/data.json @@ -7,26 +7,33 @@ "flame_state": false, "heating_state": false }, + "boiler_temperature": { + "current": 24.5, + "lower_bound": 7.0, + "resolution": 0.01, + "setpoint": 35.0, + "upper_bound": 50.0 + }, "dev_class": "heater_central", - "location": "eedadcb297564f1483faa509179aebed", - "max_dhw_temperature": { + "dhw_mode": "comfort", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 63.5, "lower_bound": 40.0, "resolution": 0.01, "setpoint": 60.0, "upper_bound": 65.0 }, - "maximum_boiler_temperature": { - "lower_bound": 7.0, - "resolution": 0.01, - "setpoint": 35.0, - "upper_bound": 50.0 - }, + "location": "eedadcb297564f1483faa509179aebed", "model": "Unknown", "name": "OnOff", "sensors": { "dhw_temperature": 63.5, "intended_boiler_temperature": 0.0, - "modulation_level": 0.0, + "modulation_level": 0, "outdoor_air_temperature": 13.5, "return_temperature": 24.9, "water_pressure": 2.0, @@ -83,17 +90,45 @@ }, "fa5fa6b34f6b40a0972988b20e888ed4": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 21.5, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Opstaan weekdag", "Werkdag schema", - "Weekend", - "off" + "Weekend" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 21.5, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 21.5, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Woonkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "vacation", @@ -120,6 +155,13 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 16.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", diff --git a/fixtures/adam_plus_anna/data.json b/fixtures/adam_plus_anna/data.json index 57d9011c1..4123a2830 100644 --- a/fixtures/adam_plus_anna/data.json +++ b/fixtures/adam_plus_anna/data.json @@ -1,15 +1,39 @@ { "009490cc2f674ce6b576863fbb64f867": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ - "Weekschema", - "off" + "off", + "Weekschema" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Living room", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", "asleep", @@ -35,6 +59,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "2743216f626f43948deec1f7ab3b3d70": { @@ -44,16 +74,22 @@ "flame_state": false, "heating_state": false }, - "dev_class": "heater_central", - "location": "07d618f0bb80412687f065b8698ce3e7", - "maximum_boiler_temperature": { + "boiler_temperature": { + "current": 48.0, "lower_bound": 0.0, "resolution": 1.0, "setpoint": 80.0, "upper_bound": 100.0 }, + "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "eco" + ], + "location": "07d618f0bb80412687f065b8698ce3e7", "model": "Generic heater", "name": "OpenTherm", + "select_dhw_mode": "eco", "sensors": { "intended_boiler_temperature": 0.0, "water_temperature": 48.0 diff --git a/fixtures/adam_plus_anna_new/data.json b/fixtures/adam_plus_anna_new/data.json index 0c1057afc..4f8af21d3 100644 --- a/fixtures/adam_plus_anna_new/data.json +++ b/fixtures/adam_plus_anna_new/data.json @@ -6,16 +6,22 @@ "flame_state": true, "heating_state": true }, - "dev_class": "heater_central", - "location": "bc93488efab249e5bc54fd7e175a6f91", - "maximum_boiler_temperature": { + "boiler_temperature": { + "current": 43.0, "lower_bound": 25.0, "resolution": 0.01, "setpoint": 50.0, "upper_bound": 95.0 }, + "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "eco" + ], + "location": "bc93488efab249e5bc54fd7e175a6f91", "model": "Generic heater", "name": "OpenTherm", + "select_dhw_mode": "eco", "sensors": { "intended_boiler_temperature": 22.5, "water_temperature": 43.0 @@ -80,7 +86,7 @@ "setpoint": 20.0, "temperature": 19.0, "temperature_difference": -0.4, - "valve_position": 100.0 + "valve_position": 100 }, "temperature_offset": { "lower_bound": -2.0, @@ -227,6 +233,7 @@ "outdoor_temperature": 15.1 }, "vendor": "Plugwise", + "wifi_mac_address": "D40FB201CBA0", "zigbee_mac_address": "000D6F000D5ACBA0" }, "da575e9e09b947e281fb6e3ebce3b174": { @@ -295,18 +302,42 @@ }, "f2bf9048bef64cc5b6d5110154e33c81": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Badkamer", "Vakantie", "Weekschema", - "Test", - "off" + "Test" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "heating", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 19.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Living room", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "vacation", "no_frost", @@ -335,6 +366,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -344,22 +381,46 @@ }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "vacation", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Badkamer", "Vakantie", "Weekschema", - "Test", - "off" + "Test" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Bathroom", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ - "vacation", "no_frost", "asleep", + "vacation", "home", "away" ], @@ -384,6 +445,12 @@ "1772a4ea304041adb83f357b751341ff" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", diff --git a/fixtures/adam_plus_anna_new_regulation_off/data.json b/fixtures/adam_plus_anna_new_regulation_off/data.json index ca57a68b6..8ec048bdd 100644 --- a/fixtures/adam_plus_anna_new_regulation_off/data.json +++ b/fixtures/adam_plus_anna_new_regulation_off/data.json @@ -6,16 +6,22 @@ "flame_state": false, "heating_state": false }, - "dev_class": "heater_central", - "location": "bc93488efab249e5bc54fd7e175a6f91", - "maximum_boiler_temperature": { + "boiler_temperature": { + "current": 30.0, "lower_bound": 25.0, "resolution": 0.01, "setpoint": 50.0, "upper_bound": 95.0 }, + "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "eco" + ], + "location": "bc93488efab249e5bc54fd7e175a6f91", "model": "Generic heater", "name": "OpenTherm", + "select_dhw_mode": "eco", "sensors": { "intended_boiler_temperature": 0.0, "water_temperature": 30.0 @@ -200,6 +206,7 @@ "outdoor_temperature": 9.19 }, "vendor": "Plugwise", + "wifi_mac_address": "012345679892", "zigbee_mac_address": "000D6F000D5A168D" }, "e2f4322d57924fa090fbbc48b3a140dc": { @@ -247,23 +254,47 @@ }, "f2bf9048bef64cc5b6d5110154e33c81": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Badkamer", "Test", "Vakantie", - "Weekschema", - "off" + "Weekschema" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.5, + "upper_bound": 30.0 + }, "climate_mode": "off", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.5, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Living room", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ - "no_frost", - "asleep", "vacation", + "no_frost", "home", + "asleep", "away" ], "select_schedule": "off", @@ -285,6 +316,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -294,18 +331,42 @@ }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Badkamer", "Test", "Vakantie", - "Weekschema", - "off" + "Weekschema" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "off", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Bathroom", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "asleep", @@ -334,6 +395,12 @@ "1772a4ea304041adb83f357b751341ff" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", diff --git a/fixtures/adam_zone_per_device/data.json b/fixtures/adam_zone_per_device/data.json index 1023633b0..40fad1963 100644 --- a/fixtures/adam_zone_per_device/data.json +++ b/fixtures/adam_zone_per_device/data.json @@ -22,25 +22,49 @@ }, "08963fec7c53423ca5680aa4cb502c63": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 14.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 21.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Badkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ - "home", "asleep", + "no_frost", "away", - "vacation", - "no_frost" + "home", + "vacation" ], "select_schedule": "Badkamer Schema", "sensors": { @@ -60,29 +84,59 @@ "680423ff840043738f42cc7f1ff97a36" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "12493538af164a409c6a1c79e38afe1c": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Bios", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 8.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", - "asleep", "away", "vacation", - "no_frost" + "no_frost", + "asleep" ], "select_schedule": "off", "sensors": { @@ -104,6 +158,12 @@ "a2c3583e0a6349358998b760cea82d2a" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "21f2b542c49845e6bb416884c55778d6": { @@ -129,19 +189,43 @@ }, "446ac08dd04d4eff8ac57489757b7314": { "active_preset": "no_frost", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Garage", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", "asleep", @@ -165,6 +249,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "4a810418d5394b3f82727340b91ba740": { @@ -226,7 +316,7 @@ "setpoint": 14.0, "temperature": 19.1, "temperature_difference": -0.3, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -285,25 +375,49 @@ }, "82fa13f017d240daa0d0ea1775420f24": { "active_preset": "asleep", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 16.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Jessie", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", - "asleep", + "no_frost", "away", "vacation", - "no_frost" + "asleep" ], "select_schedule": "CV Jessie", "sensors": { @@ -323,6 +437,12 @@ "d3da73bde12a47d5a6b8f9dad971f2ec" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 11.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "90986d591dcd426cae3ec3e8111ff730": { @@ -377,7 +497,7 @@ "setpoint": 13.0, "temperature": 17.1, "temperature_difference": -0.1, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -440,25 +560,49 @@ }, "c50f167537524366a5af7aa3942feb1e": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "heating", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 21.5, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Woonkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "preset_modes": [ - "home", + "vacation", "asleep", + "no_frost", "away", - "vacation", - "no_frost" + "home" ], "select_schedule": "GF7 Woonkamer", "sensors": { @@ -480,6 +624,12 @@ "b310b72a0e354bfab43089919b9a88bf" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "cd0ddb54ef694e11ac18ed1cbce5dbbd": { @@ -520,7 +670,7 @@ "setpoint": 16.0, "temperature": 16.9, "temperature_difference": 0.1, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -588,7 +738,7 @@ "setpoint": 5.5, "temperature": 15.6, "temperature_difference": 0.1, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, diff --git a/fixtures/anna_elga_2/data.json b/fixtures/anna_elga_2/data.json index 0611a5a7c..0aaeb5ab7 100644 --- a/fixtures/anna_elga_2/data.json +++ b/fixtures/anna_elga_2/data.json @@ -11,9 +11,14 @@ "secondary_boiler_state": true }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "eco" + ], "location": "d34dfe6ab90b410c98068e75de3eb631", "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "eco", "sensors": { "domestic_hot_water_setpoint": 60.0, "intended_boiler_temperature": 58.3, @@ -30,18 +35,46 @@ }, "ebd90df1ab334565b5895f37590ccff4": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 23.0, + "setpoint_low": 18.0, + "upper_bound": 30.0 + }, "available_schedules": [ - "Thermostat schedule", - "off" + "off", + "Thermostat schedule" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "heating", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 23.0, + "setpoint_low": 18.5, + "upper_bound": 30.0 + }, "location": "d3ce834534114348be628b61b26d9220", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "away", "no_frost", @@ -71,6 +104,13 @@ "setpoint_low": 19.5, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 27.0, + "setpoint_low": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "fb49af122f6e4b0f91267e1cf7666d6f": { @@ -89,6 +129,7 @@ "sensors": { "outdoor_temperature": 6.38 }, - "vendor": "Plugwise" + "vendor": "Plugwise", + "wifi_mac_address": "C4930002FE77" } } diff --git a/fixtures/anna_elga_2_cooling/data.json b/fixtures/anna_elga_2_cooling/data.json index e78a5ea40..f1a401941 100644 --- a/fixtures/anna_elga_2_cooling/data.json +++ b/fixtures/anna_elga_2_cooling/data.json @@ -10,20 +10,26 @@ "heating_state": false, "secondary_boiler_state": false }, - "dev_class": "heater_central", - "location": "d34dfe6ab90b410c98068e75de3eb631", - "maximum_boiler_temperature": { + "boiler_temperature": { + "current": 22.8, "lower_bound": 0.0, "resolution": 1.0, "setpoint": 60.0, "upper_bound": 100.0 }, + "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "eco" + ], + "location": "d34dfe6ab90b410c98068e75de3eb631", "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "comfort", "sensors": { "domestic_hot_water_setpoint": 60.0, "intended_boiler_temperature": 0.0, - "modulation_level": 0.0, + "modulation_level": 0, "outdoor_air_temperature": 30.0, "return_temperature": 23.4, "water_pressure": 0.5, @@ -36,18 +42,46 @@ }, "ebd90df1ab334565b5895f37590ccff4": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 23.0, + "setpoint_low": 19.0, + "upper_bound": 30.0 + }, "available_schedules": [ - "Thermostat schedule", - "off" + "off", + "Thermostat schedule" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "cooling", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 23.0, + "setpoint_low": 19.5, + "upper_bound": 30.0 + }, "location": "d3ce834534114348be628b61b26d9220", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "away", "no_frost", @@ -77,6 +111,13 @@ "setpoint_low": 4.0, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 27.0, + "setpoint_low": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "fb49af122f6e4b0f91267e1cf7666d6f": { diff --git a/fixtures/anna_elga_2_schedule_off/data.json b/fixtures/anna_elga_2_schedule_off/data.json index 3bc5f122f..ffe061a6f 100644 --- a/fixtures/anna_elga_2_schedule_off/data.json +++ b/fixtures/anna_elga_2_schedule_off/data.json @@ -10,20 +10,26 @@ "heating_state": false, "secondary_boiler_state": false }, - "dev_class": "heater_central", - "location": "d34dfe6ab90b410c98068e75de3eb631", - "maximum_boiler_temperature": { + "boiler_temperature": { + "current": 22.8, "lower_bound": 0.0, "resolution": 1.0, "setpoint": 60.0, "upper_bound": 100.0 }, + "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "eco" + ], + "location": "d34dfe6ab90b410c98068e75de3eb631", "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "comfort", "sensors": { "domestic_hot_water_setpoint": 60.0, "intended_boiler_temperature": 0.0, - "modulation_level": 0.0, + "modulation_level": 0, "outdoor_air_temperature": 13.0, "return_temperature": 23.4, "water_pressure": 0.5, @@ -36,18 +42,46 @@ }, "ebd90df1ab334565b5895f37590ccff4": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 23.0, + "setpoint_low": 19.0, + "upper_bound": 30.0 + }, "available_schedules": [ - "Thermostat schedule", - "off" + "off", + "Thermostat schedule" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "heat_cool", "control_state": "idle", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 23.0, + "setpoint_low": 19.5, + "upper_bound": 30.0 + }, "location": "d3ce834534114348be628b61b26d9220", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "away", "no_frost", @@ -77,6 +111,13 @@ "setpoint_low": 19.5, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 27.0, + "setpoint_low": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "fb49af122f6e4b0f91267e1cf7666d6f": { diff --git a/fixtures/anna_elga_no_cooling/data.json b/fixtures/anna_elga_no_cooling/data.json index 9075d01e7..ef57ecfda 100644 --- a/fixtures/anna_elga_no_cooling/data.json +++ b/fixtures/anna_elga_no_cooling/data.json @@ -26,20 +26,27 @@ "heating_state": true, "secondary_boiler_state": false }, + "boiler_temperature": { + "current": 29.1, + "lower_bound": 0.0, + "resolution": 1.0, + "setpoint": 60.0, + "upper_bound": 100.0 + }, "dev_class": "heater_central", - "location": "a57efe5f145f498c9be62a9b63626fbf", - "max_dhw_temperature": { + "dhw_mode": "eco", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 46.3, "lower_bound": 35.0, "resolution": 0.01, "setpoint": 53.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 0.0, - "resolution": 1.0, - "setpoint": 60.0, - "upper_bound": 100.0 - }, + "location": "a57efe5f145f498c9be62a9b63626fbf", "model": "Generic heater", "name": "OpenTherm", "sensors": { @@ -58,18 +65,42 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.5, + "upper_bound": 30.0 + }, "available_schedules": [ - "standaard", - "off" + "off", + "standaard" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "heating", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 21.0, + "upper_bound": 30.0 + }, "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "home", @@ -97,6 +128,12 @@ "setpoint": 20.5, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" } } diff --git a/fixtures/anna_heatpump_cooling/data.json b/fixtures/anna_heatpump_cooling/data.json index f1bdd86fe..ab6f2c7e7 100644 --- a/fixtures/anna_heatpump_cooling/data.json +++ b/fixtures/anna_heatpump_cooling/data.json @@ -28,16 +28,22 @@ "heating_state": false, "secondary_boiler_state": false }, - "dev_class": "heater_central", - "location": "a57efe5f145f498c9be62a9b63626fbf", - "maximum_boiler_temperature": { + "boiler_temperature": { + "current": 24.7, "lower_bound": 0.0, "resolution": 1.0, "setpoint": 60.0, "upper_bound": 100.0 }, + "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "eco" + ], + "location": "a57efe5f145f498c9be62a9b63626fbf", "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "eco", "sensors": { "dhw_temperature": 41.5, "domestic_hot_water_setpoint": 60.0, @@ -55,18 +61,46 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 24.0, + "setpoint_low": 20.5, + "upper_bound": 30.0 + }, "available_schedules": [ - "standaard", - "off" + "off", + "standaard" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 20.0, + "upper_bound": 30.0 + }, "climate_mode": "heat_cool", "control_state": "cooling", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 21.0, + "upper_bound": 30.0 + }, "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "home", @@ -96,6 +130,13 @@ "setpoint_low": 4.0, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 17.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" } } diff --git a/fixtures/anna_heatpump_cooling_fake_firmware/data.json b/fixtures/anna_heatpump_cooling_fake_firmware/data.json index f08a11bba..9d9f3d84e 100644 --- a/fixtures/anna_heatpump_cooling_fake_firmware/data.json +++ b/fixtures/anna_heatpump_cooling_fake_firmware/data.json @@ -28,16 +28,22 @@ "heating_state": false, "secondary_boiler_state": false }, - "dev_class": "heater_central", - "location": "a57efe5f145f498c9be62a9b63626fbf", - "maximum_boiler_temperature": { + "boiler_temperature": { + "current": 24.7, "lower_bound": 0.0, "resolution": 1.0, "setpoint": 60.0, "upper_bound": 100.0 }, + "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "eco" + ], + "location": "a57efe5f145f498c9be62a9b63626fbf", "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "eco", "sensors": { "dhw_temperature": 41.5, "domestic_hot_water_setpoint": 60.0, @@ -55,18 +61,46 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 24.0, + "setpoint_low": 20.5, + "upper_bound": 30.0 + }, "available_schedules": [ - "standaard", - "off" + "off", + "standaard" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 20.0, + "upper_bound": 30.0 + }, "climate_mode": "heat_cool", "control_state": "cooling", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 21.0, + "upper_bound": 30.0 + }, "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "home", @@ -96,6 +130,13 @@ "setpoint_low": 4.0, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 17.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" } } diff --git a/fixtures/anna_heatpump_heating/data.json b/fixtures/anna_heatpump_heating/data.json index 2d90b6f12..8deef46d8 100644 --- a/fixtures/anna_heatpump_heating/data.json +++ b/fixtures/anna_heatpump_heating/data.json @@ -28,20 +28,27 @@ "heating_state": true, "secondary_boiler_state": false }, + "boiler_temperature": { + "current": 29.1, + "lower_bound": 0.0, + "resolution": 1.0, + "setpoint": 60.0, + "upper_bound": 100.0 + }, "dev_class": "heater_central", - "location": "a57efe5f145f498c9be62a9b63626fbf", - "max_dhw_temperature": { + "dhw_mode": "eco", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 46.3, "lower_bound": 35.0, "resolution": 0.01, "setpoint": 53.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 0.0, - "resolution": 1.0, - "setpoint": 60.0, - "upper_bound": 100.0 - }, + "location": "a57efe5f145f498c9be62a9b63626fbf", "model": "Generic heater/cooler", "name": "OpenTherm", "sensors": { @@ -60,18 +67,46 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 24.0, + "setpoint_low": 20.5, + "upper_bound": 30.0 + }, "available_schedules": [ - "standaard", - "off" + "off", + "standaard" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 20.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "heating", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 21.0, + "upper_bound": 30.0 + }, "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "home", @@ -101,6 +136,13 @@ "setpoint_low": 20.5, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 17.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" } } diff --git a/fixtures/anna_loria_cooling_active/data.json b/fixtures/anna_loria_cooling_active/data.json index 66b6e1940..dbb5c9f7e 100644 --- a/fixtures/anna_loria_cooling_active/data.json +++ b/fixtures/anna_loria_cooling_active/data.json @@ -1,19 +1,47 @@ { "582dfbdace4d4aeb832923ce7d1ddda0": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.5, + "setpoint_low": 19.5, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Winter", - "Test ", - "off" + "Test " ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "cooling", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 20.5, + "setpoint_low": 20.5, + "upper_bound": 30.0 + }, "location": "15da035090b847e7a21f93e08c015ebc", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "away", "vacation", @@ -41,6 +69,13 @@ "setpoint_low": 4.0, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "9ff0569b4984459fb243af64c0901894": { @@ -70,7 +105,15 @@ "flame_state": false, "heating_state": false }, + "boiler_temperature": { + "current": 25.3, + "lower_bound": 25.0, + "resolution": 0.01, + "setpoint": 40.0, + "upper_bound": 45.0 + }, "dev_class": "heater_central", + "dhw_mode": "auto", "dhw_modes": [ "off", "auto", @@ -78,23 +121,17 @@ "eco", "comfort" ], - "location": "674b657c138a41a291d315d7471deb06", - "max_dhw_temperature": { + "dhw_temperature": { + "current": 52.9, "lower_bound": 35.0, "resolution": 0.01, "setpoint": 53.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 25.0, - "resolution": 0.01, - "setpoint": 40.0, - "upper_bound": 45.0 - }, + "location": "674b657c138a41a291d315d7471deb06", "model": "Generic heater/cooler", "model_id": "173", "name": "OpenTherm", - "select_dhw_mode": "auto", "sensors": { "dhw_temperature": 52.9, "intended_boiler_temperature": 0.0, diff --git a/fixtures/anna_loria_driessens/data.json b/fixtures/anna_loria_driessens/data.json index 06f266420..4fd7a56a8 100644 --- a/fixtures/anna_loria_driessens/data.json +++ b/fixtures/anna_loria_driessens/data.json @@ -15,25 +15,54 @@ "sensors": { "outdoor_temperature": 6.81 }, - "vendor": "Plugwise" + "vendor": "Plugwise", + "wifi_mac_address": "D40FB2011557" }, "9fb768d699e44c7fb5cc50309dc4e7d4": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 19.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Verwarmen@9-23u", "VAKANTIE (winter)", "VERWARMEN", - "KOELEN", - "off" + "KOELEN" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 26.0, + "setpoint_low": 17.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 21.0, + "setpoint_low": 20.0, + "upper_bound": 30.0 + }, "location": "fa70e08550c94de3a34feb27ecf31421", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 17.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "asleep", @@ -61,6 +90,13 @@ "setpoint_low": 20.0, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "a449cbc334ae4a5bb7f89064984b2906": { @@ -72,7 +108,15 @@ "flame_state": false, "heating_state": false }, + "boiler_temperature": { + "current": 23.3, + "lower_bound": 25.0, + "resolution": 0.01, + "setpoint": 45.0, + "upper_bound": 45.0 + }, "dev_class": "heater_central", + "dhw_mode": "auto", "dhw_modes": [ "comfort", "eco", @@ -80,27 +124,21 @@ "boost", "auto" ], - "location": "82c15f65c9bf44c592d69e16139355e3", - "max_dhw_temperature": { + "dhw_temperature": { + "current": 49.5, "lower_bound": 35.0, "resolution": 0.01, "setpoint": 53.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 25.0, - "resolution": 0.01, - "setpoint": 45.0, - "upper_bound": 45.0 - }, + "location": "82c15f65c9bf44c592d69e16139355e3", "model": "Generic heater/cooler", "model_id": "173", "name": "OpenTherm", - "select_dhw_mode": "auto", "sensors": { "dhw_temperature": 49.5, "intended_boiler_temperature": 0.0, - "modulation_level": 0.0, + "modulation_level": 0, "outdoor_air_temperature": 7.5, "return_temperature": 23.0, "water_temperature": 23.3 diff --git a/fixtures/anna_loria_heating_idle/data.json b/fixtures/anna_loria_heating_idle/data.json index 62e1ca542..532006bda 100644 --- a/fixtures/anna_loria_heating_idle/data.json +++ b/fixtures/anna_loria_heating_idle/data.json @@ -1,19 +1,47 @@ { "582dfbdace4d4aeb832923ce7d1ddda0": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.5, + "setpoint_low": 19.5, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Winter", - "Test ", - "off" + "Test " ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 20.5, + "setpoint_low": 20.5, + "upper_bound": 30.0 + }, "location": "15da035090b847e7a21f93e08c015ebc", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "away", "vacation", @@ -41,6 +69,13 @@ "setpoint_low": 20.5, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "9ff0569b4984459fb243af64c0901894": { @@ -70,7 +105,15 @@ "flame_state": false, "heating_state": false }, + "boiler_temperature": { + "current": 25.3, + "lower_bound": 25.0, + "resolution": 0.01, + "setpoint": 40.0, + "upper_bound": 45.0 + }, "dev_class": "heater_central", + "dhw_mode": "auto", "dhw_modes": [ "off", "auto", @@ -78,27 +121,21 @@ "eco", "comfort" ], - "location": "674b657c138a41a291d315d7471deb06", - "max_dhw_temperature": { + "dhw_temperature": { + "current": 52.9, "lower_bound": 35.0, "resolution": 0.01, "setpoint": 53.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 25.0, - "resolution": 0.01, - "setpoint": 40.0, - "upper_bound": 45.0 - }, + "location": "674b657c138a41a291d315d7471deb06", "model": "Generic heater/cooler", "model_id": "173", "name": "OpenTherm", - "select_dhw_mode": "auto", "sensors": { "dhw_temperature": 52.9, "intended_boiler_temperature": 0.0, - "modulation_level": 0.0, + "modulation_level": 0, "outdoor_air_temperature": 17.2, "return_temperature": 26.3, "water_temperature": 25.3 diff --git a/fixtures/anna_p1/data.json b/fixtures/anna_p1/data.json index 5918dc8fb..0a15747c5 100644 --- a/fixtures/anna_p1/data.json +++ b/fixtures/anna_p1/data.json @@ -1,18 +1,42 @@ { "1e5e55b958ac445583602f767cb45942": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ - "Thermostat schedule", - "off" + "off", + "Thermostat schedule" ], - "climate_mode": "heat", + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, + "climate_mode": "auto", "control_state": "idle", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-500", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "location": "5b13651d79c4454684fd268850b1bff8", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", "asleep", @@ -20,7 +44,7 @@ "vacation", "no_frost" ], - "select_schedule": "off", + "select_schedule": "Thermostat schedule", "sensors": { "illuminance": 2.0, "setpoint": 19.0, @@ -38,6 +62,12 @@ "setpoint": 19.0, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "36b937e44ad145bab165fa0fe99d742d": { @@ -48,13 +78,18 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "eco" + ], "location": "da7be222ab3b420c927f3e49fade0304", "model": "Generic heater", "model_id": "HR24", "name": "OpenTherm", + "select_dhw_mode": "comfort", "sensors": { "intended_boiler_temperature": 0.0, - "modulation_level": 0.0, + "modulation_level": 0, "water_pressure": 6.0, "water_temperature": 35.0 }, @@ -79,7 +114,8 @@ "sensors": { "outdoor_temperature": 11.8 }, - "vendor": "Plugwise" + "vendor": "Plugwise", + "wifi_mac_address": "C4930002ABCE" }, "da7be222ab3b420c927f3e49fade0304": { "available": true, diff --git a/fixtures/anna_v4/data.json b/fixtures/anna_v4/data.json index a64605171..c18484a03 100644 --- a/fixtures/anna_v4/data.json +++ b/fixtures/anna_v4/data.json @@ -1,19 +1,43 @@ { "01b85360fdd243d0aaad4d6ac2a5ba7e": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Standaard", - "Thuiswerken", - "off" + "Thuiswerken" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.5, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "heating", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.5, + "upper_bound": 30.0 + }, "location": "eb5309212bf5407bb143e5bfa3b18aee", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "vacation", "no_frost", @@ -39,6 +63,12 @@ "setpoint": 20.5, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "0466eae8520144c78afb29628384edeb": { @@ -66,26 +96,33 @@ "flame_state": false, "heating_state": true }, + "boiler_temperature": { + "current": 45.0, + "lower_bound": 0.0, + "resolution": 1.0, + "setpoint": 70.0, + "upper_bound": 100.0 + }, "dev_class": "heater_central", - "location": "94c107dc6ac84ed98e9f68c0dd06bf71", - "max_dhw_temperature": { + "dhw_mode": "eco", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 45.0, "lower_bound": 30.0, "resolution": 0.01, "setpoint": 60.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 0.0, - "resolution": 1.0, - "setpoint": 70.0, - "upper_bound": 100.0 - }, + "location": "94c107dc6ac84ed98e9f68c0dd06bf71", "model": "Generic heater", "model_id": "2.32", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 39.9, - "modulation_level": 0.0, + "modulation_level": 0, "return_temperature": 32.0, "water_pressure": 2.2, "water_temperature": 45.0 diff --git a/fixtures/anna_v4_dhw/data.json b/fixtures/anna_v4_dhw/data.json index 677d0a622..a1fee82a7 100644 --- a/fixtures/anna_v4_dhw/data.json +++ b/fixtures/anna_v4_dhw/data.json @@ -1,19 +1,43 @@ { "01b85360fdd243d0aaad4d6ac2a5ba7e": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Standaard", - "Thuiswerken", - "off" + "Thuiswerken" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.5, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.5, + "upper_bound": 30.0 + }, "location": "eb5309212bf5407bb143e5bfa3b18aee", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "vacation", "no_frost", @@ -39,6 +63,12 @@ "setpoint": 20.5, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "0466eae8520144c78afb29628384edeb": { @@ -66,26 +96,33 @@ "flame_state": true, "heating_state": false }, + "boiler_temperature": { + "current": 45.0, + "lower_bound": 0.0, + "resolution": 1.0, + "setpoint": 70.0, + "upper_bound": 100.0 + }, "dev_class": "heater_central", - "location": "94c107dc6ac84ed98e9f68c0dd06bf71", - "max_dhw_temperature": { + "dhw_mode": "eco", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 45.0, "lower_bound": 30.0, "resolution": 0.01, "setpoint": 60.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 0.0, - "resolution": 1.0, - "setpoint": 70.0, - "upper_bound": 100.0 - }, + "location": "94c107dc6ac84ed98e9f68c0dd06bf71", "model": "Generic heater", "model_id": "2.32", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 39.9, - "modulation_level": 0.0, + "modulation_level": 0, "return_temperature": 32.0, "water_pressure": 2.2, "water_temperature": 45.0 diff --git a/fixtures/anna_v4_no_tag/data.json b/fixtures/anna_v4_no_tag/data.json index 926b858e2..c3d9fd07b 100644 --- a/fixtures/anna_v4_no_tag/data.json +++ b/fixtures/anna_v4_no_tag/data.json @@ -1,19 +1,43 @@ { "01b85360fdd243d0aaad4d6ac2a5ba7e": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Standaard", - "Thuiswerken", - "off" + "Thuiswerken" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.5, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "heating", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.5, + "upper_bound": 30.0 + }, "location": "eb5309212bf5407bb143e5bfa3b18aee", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "vacation", "no_frost", @@ -39,6 +63,12 @@ "setpoint": 20.5, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "0466eae8520144c78afb29628384edeb": { @@ -66,26 +96,33 @@ "flame_state": false, "heating_state": true }, + "boiler_temperature": { + "current": 45.0, + "lower_bound": 0.0, + "resolution": 1.0, + "setpoint": 70.0, + "upper_bound": 100.0 + }, "dev_class": "heater_central", - "location": "94c107dc6ac84ed98e9f68c0dd06bf71", - "max_dhw_temperature": { + "dhw_mode": "eco", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 45.0, "lower_bound": 30.0, "resolution": 0.01, "setpoint": 60.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 0.0, - "resolution": 1.0, - "setpoint": 70.0, - "upper_bound": 100.0 - }, + "location": "94c107dc6ac84ed98e9f68c0dd06bf71", "model": "Generic heater", "model_id": "2.32", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 39.9, - "modulation_level": 0.0, + "modulation_level": 0, "return_temperature": 32.0, "water_pressure": 2.2, "water_temperature": 45.0 diff --git a/fixtures/anna_without_boiler_fw441/data.json b/fixtures/anna_without_boiler_fw441/data.json index 7cc9eaff3..b774a7700 100644 --- a/fixtures/anna_without_boiler_fw441/data.json +++ b/fixtures/anna_without_boiler_fw441/data.json @@ -1,19 +1,43 @@ { "7ffbb3ab4b6c4ab2915d7510f7bf8fe9": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 16.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Test", - "Normaal", - "off" + "Normaal" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 16.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 19.0, + "upper_bound": 30.0 + }, "location": "c34c6864216446528e95d88985e714cc", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "asleep", @@ -39,6 +63,12 @@ "setpoint": 19.0, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.5, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "a270735e4ccd45239424badc0578a2b1": { @@ -57,7 +87,8 @@ "sensors": { "outdoor_temperature": 8.31 }, - "vendor": "Plugwise" + "vendor": "Plugwise", + "wifi_mac_address": "D40FB200FA1D" }, "c46b4794d28149699eacf053deedd003": { "binary_sensors": { diff --git a/fixtures/legacy_anna/data.json b/fixtures/legacy_anna/data.json index f4a30b8fa..4ac8e8cce 100644 --- a/fixtures/legacy_anna/data.json +++ b/fixtures/legacy_anna/data.json @@ -13,20 +13,21 @@ "flame_state": true, "heating_state": true }, - "dev_class": "heater_central", - "location": "0000aaaa0000aaaa0000aaaa0000aa00", - "maximum_boiler_temperature": { + "boiler_temperature": { + "current": 23.6, "lower_bound": 50.0, "resolution": 1.0, "setpoint": 50.0, "upper_bound": 90.0 }, + "dev_class": "heater_central", + "location": "0000aaaa0000aaaa0000aaaa0000aa00", "model": "Generic heater", "name": "OpenTherm", "sensors": { "dhw_temperature": 51.2, "intended_boiler_temperature": 17.0, - "modulation_level": 0.0, + "modulation_level": 0, "return_temperature": 21.7, "water_pressure": 1.2, "water_temperature": 23.6 @@ -35,7 +36,9 @@ }, "0d266432d64443e283b5d708ae98b455": { "active_preset": "home", - "available_schedules": [], + "available_schedules": [ + "off" + ], "climate_mode": "heat", "control_state": "heating", "dev_class": "thermostat", @@ -51,7 +54,7 @@ "home", "no_frost" ], - "select_schedule": null, + "select_schedule": "off", "sensors": { "illuminance": 150.8, "setpoint": 20.5, diff --git a/fixtures/legacy_anna_2/data.json b/fixtures/legacy_anna_2/data.json index bb28848a9..2e7b7e289 100644 --- a/fixtures/legacy_anna_2/data.json +++ b/fixtures/legacy_anna_2/data.json @@ -2,8 +2,8 @@ "9e7377867dc24e51b8098a5ba02bd89d": { "active_preset": null, "available_schedules": [ - "Thermostat schedule", - "off" + "off", + "Thermostat schedule" ], "climate_mode": "heat", "control_state": "idle", @@ -51,20 +51,21 @@ "flame_state": false, "heating_state": false }, - "dev_class": "heater_central", - "location": "be81e3f8275b4129852c4d8d550ae2eb", - "maximum_boiler_temperature": { + "boiler_temperature": { + "current": 54.0, "lower_bound": 50.0, "resolution": 1.0, "setpoint": 70.0, "upper_bound": 90.0 }, + "dev_class": "heater_central", + "location": "be81e3f8275b4129852c4d8d550ae2eb", "model": "Generic heater", "name": "OpenTherm", "sensors": { "dhw_temperature": 0.0, "intended_boiler_temperature": 0.0, - "modulation_level": 0.0, + "modulation_level": 0, "return_temperature": 0.0, "water_pressure": 1.7, "water_temperature": 54.0 diff --git a/fixtures/m_adam_cooling/data.json b/fixtures/m_adam_cooling/data.json index d1b3753ea..ba13d7634 100644 --- a/fixtures/m_adam_cooling/data.json +++ b/fixtures/m_adam_cooling/data.json @@ -7,16 +7,22 @@ "flame_state": false, "heating_state": false }, - "dev_class": "heater_central", - "location": "bc93488efab249e5bc54fd7e175a6f91", - "maximum_boiler_temperature": { + "boiler_temperature": { + "current": 19.0, "lower_bound": 25.0, "resolution": 0.01, "setpoint": 50.0, "upper_bound": 95.0 }, + "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "eco" + ], + "location": "bc93488efab249e5bc54fd7e175a6f91", "model": "Generic heater", "name": "OpenTherm", + "select_dhw_mode": "eco", "sensors": { "intended_boiler_temperature": 17.5, "water_temperature": 19.0 @@ -69,7 +75,7 @@ "setpoint": 25.0, "temperature": 24.8, "temperature_difference": -0.4, - "valve_position": 100.0 + "valve_position": 100 }, "temperature_offset": { "lower_bound": -2.0, @@ -138,6 +144,7 @@ "outdoor_temperature": 29.65 }, "vendor": "Plugwise", + "wifi_mac_address": "D40FB201CBA0", "zigbee_mac_address": "000D6F000D5ACBA0" }, "da575e9e09b947e281fb6e3ebce3b174": { @@ -206,18 +213,46 @@ }, "f2bf9048bef64cc5b6d5110154e33c81": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 24.0, + "setpoint_low": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Badkamer", "Vakantie", "Weekschema", - "Test", - "off" + "Test" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 17.0, + "upper_bound": 30.0 + }, "climate_mode": "cool", "control_state": "cooling", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 19.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Living room", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "vacation", "no_frost", @@ -246,6 +281,13 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -255,22 +297,50 @@ }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "vacation", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 24.0, + "setpoint_low": 12.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Badkamer", "Vakantie", "Weekschema", - "Test", - "off" + "Test" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "cooling", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 18.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Bathroom", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ - "vacation", "no_frost", "asleep", + "vacation", "home", "away" ], @@ -295,6 +365,13 @@ "1772a4ea304041adb83f357b751341ff" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 12.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", diff --git a/fixtures/m_adam_heating/data.json b/fixtures/m_adam_heating/data.json index 208b6df84..7fcbc3ed4 100644 --- a/fixtures/m_adam_heating/data.json +++ b/fixtures/m_adam_heating/data.json @@ -6,20 +6,27 @@ "flame_state": false, "heating_state": true }, + "boiler_temperature": { + "current": 37.0, + "lower_bound": 25.0, + "resolution": 0.01, + "setpoint": 50.0, + "upper_bound": 95.0 + }, "dev_class": "heater_central", - "location": "bc93488efab249e5bc54fd7e175a6f91", - "max_dhw_temperature": { + "dhw_mode": "eco", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 37.0, "lower_bound": 40.0, "resolution": 0.01, "setpoint": 60.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 25.0, - "resolution": 0.01, - "setpoint": 50.0, - "upper_bound": 95.0 - }, + "location": "bc93488efab249e5bc54fd7e175a6f91", "model": "Generic heater", "name": "OpenTherm", "sensors": { @@ -74,7 +81,7 @@ "setpoint": 25.0, "temperature": 18.6, "temperature_difference": -0.4, - "valve_position": 100.0 + "valve_position": 100 }, "temperature_offset": { "lower_bound": -2.0, @@ -142,6 +149,7 @@ "outdoor_temperature": -1.25 }, "vendor": "Plugwise", + "wifi_mac_address": "D40FB201CBA0", "zigbee_mac_address": "000D6F000D5ACBA0" }, "da575e9e09b947e281fb6e3ebce3b174": { @@ -210,18 +218,42 @@ }, "f2bf9048bef64cc5b6d5110154e33c81": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Badkamer", "Vakantie", "Weekschema", - "Test", - "off" + "Test" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "preheating", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 19.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Living room", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "vacation", "no_frost", @@ -250,6 +282,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -259,22 +297,46 @@ }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "vacation", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "Badkamer", "Vakantie", "Weekschema", - "Test", - "off" + "Test" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Bathroom", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ - "vacation", "no_frost", "asleep", + "vacation", "home", "away" ], @@ -299,6 +361,12 @@ "1772a4ea304041adb83f357b751341ff" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", diff --git a/fixtures/m_adam_heating_off_schedule/data.json b/fixtures/m_adam_heating_off_schedule/data.json new file mode 100644 index 000000000..3af382e4e --- /dev/null +++ b/fixtures/m_adam_heating_off_schedule/data.json @@ -0,0 +1,377 @@ +{ + "056ee145a816487eaa69243c3280f8bf": { + "available": true, + "binary_sensors": { + "dhw_state": false, + "flame_state": false, + "heating_state": false + }, + "boiler_temperature": { + "current": 37.0, + "lower_bound": 25.0, + "resolution": 0.01, + "setpoint": 50.0, + "upper_bound": 95.0 + }, + "dev_class": "heater_central", + "dhw_mode": "eco", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 37.0, + "lower_bound": 40.0, + "resolution": 0.01, + "setpoint": 60.0, + "upper_bound": 60.0 + }, + "location": "bc93488efab249e5bc54fd7e175a6f91", + "model": "Generic heater", + "name": "OpenTherm", + "sensors": { + "intended_boiler_temperature": 0.0, + "water_temperature": 37.0 + }, + "switches": { + "dhw_cm_switch": false + } + }, + "14df5c4dc8cb4ba69f9d1ac0eaf7c5c6": { + "available": true, + "binary_sensors": { + "low_battery": false + }, + "dev_class": "zone_thermostat", + "firmware": "2025-11-10T01:00:00+01:00", + "hardware": "1", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "Emma Pro", + "model_id": "170-01", + "name": "Emma", + "sensors": { + "battery": 100, + "humidity": 65.0, + "setpoint": 20.0, + "temperature": 19.5 + }, + "temperature_offset": { + "lower_bound": -2.0, + "resolution": 0.1, + "setpoint": 0.0, + "upper_bound": 2.0 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "60EFABFFFE89CBA0" + }, + "1772a4ea304041adb83f357b751341ff": { + "available": true, + "binary_sensors": { + "low_battery": false + }, + "dev_class": "thermostatic_radiator_valve", + "firmware": "2020-11-04T01:00:00+01:00", + "hardware": "1", + "location": "f871b8c4d63549319221e294e4f88074", + "model": "Tom", + "model_id": "106-03", + "name": "Tom Badkamer", + "sensors": { + "battery": 60, + "setpoint": 25.0, + "temperature": 18.6, + "temperature_difference": -0.4, + "valve_position": 100 + }, + "temperature_offset": { + "lower_bound": -2.0, + "resolution": 0.1, + "setpoint": 0.1, + "upper_bound": 2.0 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000C8FCBA0" + }, + "ad4838d7d35c4d6ea796ee12ae5aedf8": { + "dev_class": "thermostat", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "ThermoTouch", + "model_id": "143.1", + "name": "Anna", + "sensors": { + "setpoint": 20.0, + "temperature": 19.1 + }, + "vendor": "Plugwise" + }, + "c9293d1d68ee48fc8843c6f0dee2b6be": { + "dev_class": "pumping", + "members": [ + "854f8a9b0e7e425db97f1f110e1ce4b3", + "ad4838d7d35c4d6ea796ee12ae5aedf8" + ], + "model": "Group", + "name": "Vloerverwarming", + "sensors": { + "electricity_consumed": 45.0, + "electricity_produced": 0.0, + "temperature": 20.1 + }, + "vendor": "Plugwise" + }, + "da224107914542988a88561b4452b0f6": { + "binary_sensors": { + "plugwise_notification": false + }, + "dev_class": "gateway", + "firmware": "3.9.0", + "gateway_modes": [ + "away", + "full", + "vacation" + ], + "hardware": "AME Smile 2.0 board", + "location": "bc93488efab249e5bc54fd7e175a6f91", + "mac_address": "D40FB201CBA0", + "model": "Gateway", + "model_id": "smile_open_therm", + "name": "Adam", + "notifications": {}, + "regulation_modes": [ + "bleeding_cold", + "heating", + "off", + "bleeding_hot" + ], + "select_gateway_mode": "full", + "select_regulation_mode": "off", + "sensors": { + "outdoor_temperature": -1.25 + }, + "vendor": "Plugwise", + "wifi_mac_address": "D40FB201CBA0", + "zigbee_mac_address": "000D6F000D5ACBA0" + }, + "da575e9e09b947e281fb6e3ebce3b174": { + "available": true, + "binary_sensors": { + "low_battery": false + }, + "dev_class": "zone_thermometer", + "firmware": "2020-09-01T02:00:00+02:00", + "hardware": "1", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "Jip", + "model_id": "168-01", + "name": "Jip", + "sensors": { + "battery": 100, + "humidity": 65.8, + "setpoint": 20.0, + "temperature": 19.3 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "70AC08FFFEE1CBA0" + }, + "e2f4322d57924fa090fbbc48b3a140dc": { + "available": true, + "binary_sensors": { + "low_battery": false + }, + "dev_class": "zone_thermostat", + "firmware": "2016-10-10T02:00:00+02:00", + "hardware": "255", + "location": "f871b8c4d63549319221e294e4f88074", + "model": "Lisa", + "model_id": "158-01", + "name": "Lisa Badkamer", + "sensors": { + "battery": 71, + "setpoint": 15.0, + "temperature": 17.9 + }, + "temperature_offset": { + "lower_bound": -2.0, + "resolution": 0.1, + "setpoint": 0.0, + "upper_bound": 2.0 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000C86CBA0" + }, + "e8ef2a01ed3b4139a53bf749204fe6b4": { + "dev_class": "switching", + "members": [ + "2568cc4b9c1e401495d4741a5f89bee1", + "29542b2b6a6a4169acecc15c72a599b8" + ], + "model": "Group", + "name": "Test", + "sensors": { + "electricity_consumed": 16.5, + "electricity_produced": 0.0 + }, + "switches": { + "relay": true + }, + "vendor": "Plugwise" + }, + "f2bf9048bef64cc5b6d5110154e33c81": { + "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, + "available_schedules": [ + "off", + "Badkamer", + "Vakantie", + "Weekschema", + "Test" + ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, + "climate_mode": "off", + "control_state": "idle", + "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 19.0, + "upper_bound": 30.0 + }, + "model": "ThermoZone", + "name": "Living room", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, + "preset_modes": [ + "vacation", + "no_frost", + "asleep", + "home", + "away" + ], + "select_schedule": "off", + "select_zone_profile": "active", + "sensors": { + "electricity_consumed": 60.8, + "electricity_produced": 0.0, + "temperature": 19.1 + }, + "thermostat": { + "lower_bound": 1.0, + "resolution": 0.01, + "setpoint": 20.0, + "upper_bound": 35.0 + }, + "thermostats": { + "primary": [ + "ad4838d7d35c4d6ea796ee12ae5aedf8", + "14df5c4dc8cb4ba69f9d1ac0eaf7c5c6", + "da575e9e09b947e281fb6e3ebce3b174" + ], + "secondary": [] + }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, + "vendor": "Plugwise", + "zone_profiles": [ + "active", + "off", + "passive" + ] + }, + "f871b8c4d63549319221e294e4f88074": { + "active_preset": "vacation", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, + "available_schedules": [ + "off", + "Badkamer", + "Vakantie", + "Weekschema", + "Test" + ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, + "climate_mode": "off", + "control_state": "idle", + "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.0, + "upper_bound": 30.0 + }, + "model": "ThermoZone", + "name": "Bathroom", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, + "preset_modes": [ + "no_frost", + "asleep", + "vacation", + "home", + "away" + ], + "select_schedule": "Badkamer", + "select_zone_profile": "passive", + "sensors": { + "electricity_consumed": 0.0, + "electricity_produced": 0.0, + "temperature": 17.9 + }, + "thermostat": { + "lower_bound": 0.0, + "resolution": 0.01, + "setpoint": 15.0, + "upper_bound": 99.9 + }, + "thermostats": { + "primary": [ + "e2f4322d57924fa090fbbc48b3a140dc" + ], + "secondary": [ + "1772a4ea304041adb83f357b751341ff" + ] + }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, + "vendor": "Plugwise", + "zone_profiles": [ + "active", + "off", + "passive" + ] + } +} diff --git a/fixtures/m_adam_jip/data.json b/fixtures/m_adam_jip/data.json index a473c7748..a65d9ceb7 100644 --- a/fixtures/m_adam_jip/data.json +++ b/fixtures/m_adam_jip/data.json @@ -1,19 +1,45 @@ { "06aecb3d00354375924f50c47af36bd2": { "active_preset": "no_frost", - "available_schedules": [], + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, + "available_schedules": [ + "off" + ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, "climate_mode": "off", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Slaapkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 9.0, + "upper_bound": 30.0 + }, "preset_modes": [ + "vacation", + "no_frost", "home", - "asleep", "away", - "vacation", - "no_frost" + "asleep" ], - "select_schedule": null, + "select_schedule": "off", "select_zone_profile": "active", "sensors": { "temperature": 24.2 @@ -32,6 +58,12 @@ "356b65335e274d769c338223e7af9c33" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -41,12 +73,38 @@ }, "13228dab8ce04617af318a2888b3c548": { "active_preset": "home", - "available_schedules": [], + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, + "available_schedules": [ + "off" + ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Woonkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", "asleep", @@ -54,7 +112,7 @@ "vacation", "no_frost" ], - "select_schedule": null, + "select_schedule": "off", "select_zone_profile": "active", "sensors": { "temperature": 27.4 @@ -73,6 +131,12 @@ "833de10f269c4deab58fb9df69901b4e" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -119,7 +183,7 @@ "setpoint": 13.0, "temperature": 28.8, "temperature_difference": 2.0, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -143,7 +207,7 @@ "setpoint": 13.0, "temperature": 24.2, "temperature_difference": 1.7, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -281,20 +345,46 @@ }, "d27aede973b54be484f6842d1b2802ad": { "active_preset": "home", - "available_schedules": [], + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, + "available_schedules": [ + "off" + ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Kinderkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 9.0, + "upper_bound": 30.0 + }, "preset_modes": [ + "vacation", + "no_frost", "home", - "asleep", "away", - "vacation", - "no_frost" + "asleep" ], - "select_schedule": null, + "select_schedule": "off", "select_zone_profile": "active", "sensors": { "temperature": 30.0 @@ -313,6 +403,12 @@ "d4496250d0e942cfa7aea3476e9070d5" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -333,7 +429,7 @@ "setpoint": 13.0, "temperature": 28.7, "temperature_difference": 1.9, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -346,20 +442,46 @@ }, "d58fec52899f4f1c92e4f8fad6d8c48c": { "active_preset": "home", - "available_schedules": [], + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, + "available_schedules": [ + "off" + ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 13.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Logeerkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 9.0, + "upper_bound": 30.0 + }, "preset_modes": [ + "vacation", + "no_frost", "home", - "asleep", "away", - "vacation", - "no_frost" + "asleep" ], - "select_schedule": null, + "select_schedule": "off", "select_zone_profile": "active", "sensors": { "temperature": 30.0 @@ -378,6 +500,12 @@ "1da4d325838e4ad8aac12177214505c9" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise", "zone_profiles": [ "active", @@ -392,26 +520,33 @@ "flame_state": false, "heating_state": false }, + "boiler_temperature": { + "current": 37.3, + "lower_bound": 20.0, + "resolution": 0.01, + "setpoint": 90.0, + "upper_bound": 90.0 + }, "dev_class": "heater_central", - "location": "9e4433a9d69f40b3aefd15e74395eaec", - "max_dhw_temperature": { + "dhw_mode": "eco", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 37.3, "lower_bound": 40.0, "resolution": 0.01, "setpoint": 60.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 20.0, - "resolution": 0.01, - "setpoint": 90.0, - "upper_bound": 90.0 - }, + "location": "9e4433a9d69f40b3aefd15e74395eaec", "model": "Generic heater", "model_id": "10.20", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 0.0, - "modulation_level": 0.0, + "modulation_level": 0, "return_temperature": 37.1, "water_pressure": 1.4, "water_temperature": 37.3 diff --git a/fixtures/m_adam_multiple_devices_per_zone/data.json b/fixtures/m_adam_multiple_devices_per_zone/data.json index dff7c2466..0d9b61939 100644 --- a/fixtures/m_adam_multiple_devices_per_zone/data.json +++ b/fixtures/m_adam_multiple_devices_per_zone/data.json @@ -22,25 +22,49 @@ }, "08963fec7c53423ca5680aa4cb502c63": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 14.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 21.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Badkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ - "home", "asleep", + "no_frost", "away", - "vacation", - "no_frost" + "home", + "vacation" ], "select_schedule": "Badkamer Schema", "sensors": { @@ -59,29 +83,59 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "12493538af164a409c6a1c79e38afe1c": { "active_preset": "away", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Bios", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 8.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", - "asleep", "away", "vacation", - "no_frost" + "no_frost", + "asleep" ], "select_schedule": "off", "sensors": { @@ -103,6 +157,12 @@ "a2c3583e0a6349358998b760cea82d2a" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "21f2b542c49845e6bb416884c55778d6": { @@ -128,12 +188,38 @@ }, "446ac08dd04d4eff8ac57489757b7314": { "active_preset": "no_frost", - "available_schedules": [], + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, + "available_schedules": [ + "off" + ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Garage", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", "asleep", @@ -141,7 +227,7 @@ "vacation", "no_frost" ], - "select_schedule": null, + "select_schedule": "off", "sensors": { "temperature": 15.6 }, @@ -157,6 +243,12 @@ ], "secondary": [] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "4a810418d5394b3f82727340b91ba740": { @@ -218,7 +310,7 @@ "setpoint": 14.0, "temperature": 19.1, "temperature_difference": -0.4, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -277,25 +369,49 @@ }, "82fa13f017d240daa0d0ea1775420f24": { "active_preset": "asleep", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 16.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 20.0, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Jessie", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "home", - "asleep", + "no_frost", "away", "vacation", - "no_frost" + "asleep" ], "select_schedule": "CV Jessie", "sensors": { @@ -315,6 +431,12 @@ "d3da73bde12a47d5a6b8f9dad971f2ec" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 11.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "90986d591dcd426cae3ec3e8111ff730": { @@ -369,7 +491,7 @@ "setpoint": 13.0, "temperature": 17.2, "temperature_difference": -0.2, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -432,25 +554,49 @@ }, "c50f167537524366a5af7aa3942feb1e": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 18.0, + "upper_bound": 30.0 + }, "available_schedules": [ + "off", "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", - "CV Jessie", - "off" + "CV Jessie" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 17.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "heating", "dev_class": "climate", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 21.5, + "upper_bound": 30.0 + }, "model": "ThermoZone", "name": "Woonkamer", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 12.0, + "upper_bound": 30.0 + }, "preset_modes": [ - "home", + "vacation", "asleep", + "no_frost", "away", - "vacation", - "no_frost" + "home" ], "select_schedule": "GF7 Woonkamer", "sensors": { @@ -472,6 +618,12 @@ "b310b72a0e354bfab43089919b9a88bf" ] }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint": 15.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" }, "cd0ddb54ef694e11ac18ed1cbce5dbbd": { @@ -512,7 +664,7 @@ "setpoint": 15.0, "temperature": 17.1, "temperature_difference": 0.1, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, @@ -580,7 +732,7 @@ "setpoint": 5.5, "temperature": 15.6, "temperature_difference": 0.0, - "valve_position": 0.0 + "valve_position": 0 }, "temperature_offset": { "lower_bound": -2.0, diff --git a/fixtures/m_anna_heatpump_cooling/data.json b/fixtures/m_anna_heatpump_cooling/data.json index e12f137bd..a4f23c17b 100644 --- a/fixtures/m_anna_heatpump_cooling/data.json +++ b/fixtures/m_anna_heatpump_cooling/data.json @@ -28,20 +28,27 @@ "heating_state": false, "secondary_boiler_state": false }, + "boiler_temperature": { + "current": 22.7, + "lower_bound": 0.0, + "resolution": 1.0, + "setpoint": 60.0, + "upper_bound": 100.0 + }, "dev_class": "heater_central", - "location": "a57efe5f145f498c9be62a9b63626fbf", - "max_dhw_temperature": { + "dhw_mode": "eco", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 41.5, "lower_bound": 35.0, "resolution": 0.01, "setpoint": 53.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 0.0, - "resolution": 1.0, - "setpoint": 60.0, - "upper_bound": 100.0 - }, + "location": "a57efe5f145f498c9be62a9b63626fbf", "model": "Generic heater/cooler", "name": "OpenTherm", "sensors": { @@ -60,18 +67,46 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 24.0, + "setpoint_low": 20.5, + "upper_bound": 30.0 + }, "available_schedules": [ - "standaard", - "off" + "off", + "standaard" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 20.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "cooling", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 21.0, + "upper_bound": 30.0 + }, "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "home", @@ -101,6 +136,13 @@ "setpoint_low": 20.5, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 17.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" } } diff --git a/fixtures/m_anna_heatpump_idle/data.json b/fixtures/m_anna_heatpump_idle/data.json index 5e3c3c6f3..6cd2a5524 100644 --- a/fixtures/m_anna_heatpump_idle/data.json +++ b/fixtures/m_anna_heatpump_idle/data.json @@ -28,30 +28,37 @@ "heating_state": false, "secondary_boiler_state": false }, + "boiler_temperature": { + "current": 19.1, + "lower_bound": 0.0, + "resolution": 1.0, + "setpoint": 60.0, + "upper_bound": 100.0 + }, "dev_class": "heater_central", - "location": "a57efe5f145f498c9be62a9b63626fbf", - "max_dhw_temperature": { + "dhw_mode": "eco", + "dhw_modes": [ + "comfort", + "eco" + ], + "dhw_temperature": { + "current": 46.3, "lower_bound": 35.0, "resolution": 0.01, "setpoint": 53.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 0.0, - "resolution": 1.0, - "setpoint": 60.0, - "upper_bound": 100.0 - }, + "location": "a57efe5f145f498c9be62a9b63626fbf", "model": "Generic heater/cooler", "name": "OpenTherm", "sensors": { - "dhw_temperature": 46.3, + "dhw_temperature": 41.5, "intended_boiler_temperature": 18.0, "modulation_level": 0, "outdoor_air_temperature": 28.2, "return_temperature": 22.0, "water_pressure": 1.57, - "water_temperature": 19.1 + "water_temperature": 22.7 }, "switches": { "dhw_cm_switch": false @@ -60,18 +67,46 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", + "asleep_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 24.0, + "setpoint_low": 20.5, + "upper_bound": 30.0 + }, "available_schedules": [ - "standaard", - "off" + "off", + "standaard" ], + "away_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 25.0, + "setpoint_low": 20.0, + "upper_bound": 30.0 + }, "climate_mode": "auto", "control_state": "idle", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", + "home_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 22.0, + "setpoint_low": 21.0, + "upper_bound": 30.0 + }, "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", "name": "Anna", + "no_frost_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 30.0, + "setpoint_low": 10.0, + "upper_bound": 30.0 + }, "preset_modes": [ "no_frost", "home", @@ -101,6 +136,13 @@ "setpoint_low": 20.5, "upper_bound": 30.0 }, + "vacation_preset_temperature": { + "lower_bound": 4.0, + "resolution": 0.5, + "setpoint_high": 28.0, + "setpoint_low": 17.0, + "upper_bound": 30.0 + }, "vendor": "Plugwise" } } diff --git a/fixtures/p1v4_442_single/data.json b/fixtures/p1v4_442_single/data.json index 6dfcd7ee0..f457c6c09 100644 --- a/fixtures/p1v4_442_single/data.json +++ b/fixtures/p1v4_442_single/data.json @@ -12,7 +12,8 @@ "model_id": "smile", "name": "Smile P1", "notifications": {}, - "vendor": "Plugwise" + "vendor": "Plugwise", + "wifi_mac_address": "012345670002" }, "ba4de7613517478da82dd9b6abea36af": { "available": true, diff --git a/fixtures/p1v4_442_triple/data.json b/fixtures/p1v4_442_triple/data.json index 943325d14..c5989ce4b 100644 --- a/fixtures/p1v4_442_triple/data.json +++ b/fixtures/p1v4_442_triple/data.json @@ -16,7 +16,8 @@ "warning": "The Smile P1 is not connected to a smart meter." } }, - "vendor": "Plugwise" + "vendor": "Plugwise", + "wifi_mac_address": "012345670002" }, "b82b6b3322484f2ea4e25e0bd5f3d61f": { "available": true, diff --git a/plugwise/__init__.py b/plugwise/__init__.py index 9c4cd84dd..feb0b39d2 100644 --- a/plugwise/__init__.py +++ b/plugwise/__init__.py @@ -60,8 +60,8 @@ def __init__( password, port, self._timeout, - username, - websession, + username=username, + websession=websession, ) self._cooling_present = False @@ -85,6 +85,7 @@ def __init__( self.smile.name = NONE self.smile.type = NONE self.smile.version = Version("0.0.0") + self.smile.wifi_mac_address = None self.smile.zigbee_mac_address = None @property @@ -187,28 +188,20 @@ async def _smile_detect( """Helper-function for connect(). Detect which type of Plugwise Gateway is being connected. + Store the collected data, also collect some specific thermostat devices. """ - model: str = "Unknown" + model = await self._collect_smile_data(dsmrmain, result) + self._store_smile_data(model) + self._process_for_thermostat(result) + + async def _collect_smile_data( + self, dsmrmain: etree.Element, result: etree.Element + ) -> str: + """Collect smile/gateway data.""" if (gateway := result.find("./gateway")) is not None: - self.smile.version = parse(gateway.find("firmware_version").text) - self.smile.hw_version = gateway.find("hardware_version").text - self.smile.hostname = gateway.find("hostname").text - self.smile.mac_address = gateway.find("mac_address").text - if (vendor_model := gateway.find("vendor_model")) is None: - return # pragma: no cover - - model = vendor_model.text - elec_measurement = gateway.find( - "gateway_environment/electricity_consumption_tariff_structure" - ) - if ( - elec_measurement is not None - and elec_measurement.text - and model == "smile_thermo" - ): - self.smile.anna_p1 = True + model = self._collect_gateway_data(gateway, result) else: - model = await self._smile_detect_legacy(result, dsmrmain, model) + model = await self._smile_detect_legacy(result, dsmrmain, "Unknown") if model == "Unknown" or self.smile.version == Version( "0.0.0" @@ -220,6 +213,58 @@ async def _smile_detect( ) raise UnsupportedDeviceError + return model + + def _collect_gateway_data( + self, gateway: etree.Element, result: etree.Element + ) -> str: + """Collect data from a current-generation gateway.""" + self.smile.version = parse(gateway.find("firmware_version").text) + self.smile.hw_version = gateway.find("hardware_version").text + self.smile.hostname = gateway.find("hostname").text + self.smile.mac_address = gateway.find("mac_address").text + if (wifi_mac := gateway.find("wifi_mac_address")) is not None: + self.smile.wifi_mac_address = wifi_mac.text + + model: str = gateway.findtext("vendor_model", "Unknown") + if model == "smile_thermo": + has_anna_p1 = any( + meter.get("id") + for meter in result.findall( + "./location/logs/point_log/electricity_point_meter" + ) + ) + if has_anna_p1: + self.smile.anna_p1 = True + return model + + def _process_for_thermostat(self, result: etree.Element) -> None: + """Extra processing for thermostats.""" + if self.smile.type != "thermostat": + return + + self._is_thermostat = True + # For Adam, Anna, determine the system capabilities: + # Find the connected heating/cooling device (heater_central), + # e.g. heat-pump or gas-fired heater + onoff_boiler = result.find("./module/protocols/onoff_boiler") + open_therm_boiler = result.find("./module/protocols/open_therm_boiler") + self._on_off_device = onoff_boiler is not None + self._opentherm_device = open_therm_boiler is not None + + # Determine the presence of special features + locator_1 = "./gateway/features/cooling" + locator_2 = "./gateway/features/elga_support" + if result.find(locator_1) is not None: + self._cooling_present = True + if result.find(locator_2) is not None: + self._elga = True + + def _store_smile_data(self, model: str) -> None: + """Store the collected the smile/gateway data. + + Perform some checks, and set a shorter timeout for non-legacy Gateways. + """ version_major = str(self.smile.version.major) self._target_smile = f"{model}_v{version_major}" LOGGER.debug("Plugwise identified as %s", self._target_smile) @@ -251,30 +296,6 @@ async def _smile_detect( if self.smile.type == "stretch": self._stretch_v2 = int(version_major) == 2 - self._process_for_thermostat(result) - - def _process_for_thermostat(self, result: etree.Element) -> None: - """Extra processing for thermostats.""" - if self.smile.type != "thermostat": - return - - self._is_thermostat = True - # For Adam, Anna, determine the system capabilities: - # Find the connected heating/cooling device (heater_central), - # e.g. heat-pump or gas-fired heater - onoff_boiler = result.find("./module/protocols/onoff_boiler") - open_therm_boiler = result.find("./module/protocols/open_therm_boiler") - self._on_off_device = onoff_boiler is not None - self._opentherm_device = open_therm_boiler is not None - - # Determine the presence of special features - locator_1 = "./gateway/features/cooling" - locator_2 = "./gateway/features/elga_support" - if result.find(locator_1) is not None: - self._cooling_present = True - if result.find(locator_2) is not None: - self._elga = True - async def _smile_detect_legacy( self, result: etree.Element, dsmrmain: etree.Element, model: str ) -> str: @@ -345,11 +366,11 @@ async def set_select( key: str, loc_id: str, option: str, - state: str | None = None, + state: int | str | None = None, ) -> None: """Set the selected option for the applicable Select.""" try: - await self._smile_api.set_select(key, loc_id, option, state) + await self._smile_api.set_select(key, loc_id, option, state=state) except ConnectionFailedError as exc: raise ConnectionFailedError( f"Failed to set select option '{option}': {str(exc)}" @@ -358,12 +379,12 @@ async def set_select( async def set_schedule_state( self, loc_id: str, - state: str | None, name: str | None = None, + state: int | str | None = None, ) -> None: """Activate/deactivate the Schedule, with the given name, on the relevant Thermostat.""" try: - await self._smile_api.set_schedule_state(loc_id, state, name) + await self._smile_api.set_schedule_state(loc_id, name=name, state=state) except ConnectionFailedError as exc: # pragma no cover raise ConnectionFailedError( f"Failed to set schedule state: {str(exc)}" @@ -390,10 +411,11 @@ async def set_number( dev_id: str, key: str, temperature: float, + setpoint: str = "setpoint", ) -> None: - """Set the maximum boiler- or DHW-setpoint on the Central Heating boiler or the temperature-offset on a Thermostat.""" + """Set the maximum boiler- or DHW-setpoint on the Central Heating boiler, the temperature-offset on a Thermostat or a preset temperature.""" try: - await self._smile_api.set_number(dev_id, key, temperature) + await self._smile_api.set_number(dev_id, key, temperature, setpoint) except ConnectionFailedError as exc: raise ConnectionFailedError( f"Failed to set number '{key}': {str(exc)}" @@ -410,7 +432,7 @@ async def set_temperature_offset(self, dev_id: str, offset: float) -> None: async def set_switch_state( self, appl_id: str, members: list[str] | None, model: str, state: str - ) -> bool: + ) -> bool | None: """Set the given State of the relevant Switch. Return the result: @@ -448,10 +470,17 @@ async def set_regulation_mode(self, mode: str) -> None: f"Failed to set regulation mode: {str(exc)}" ) from exc # pragma no cover - async def set_dhw_mode(self, mode: str) -> None: + async def set_dhw_mode( + self, key: str, location: str, mode: str, length: int | str | None = None + ) -> None: """Set the domestic hot water heating regulation mode.""" try: # pragma no cover - await self._smile_api.set_dhw_mode(mode) # pragma: no cover + await self._smile_api.set_dhw_mode( + key, + location, + mode, + length=length, + ) # pragma: no cover except ConnectionFailedError as exc: # pragma no cover raise ConnectionFailedError( f"Failed to set dhw mode: {str(exc)}" diff --git a/plugwise/common.py b/plugwise/common.py index 0c36be74f..0f40b4e1b 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -9,11 +9,13 @@ from plugwise.constants import ( ANNA, + DHW_SETPOINT, GROUP_TYPES, NONE, PRIORITY_DEVICE_CLASSES, SPECIAL_PLUG_TYPES, SWITCH_GROUP_TYPES, + ActuatorData, ApplianceType, GwEntityData, ModuleData, @@ -158,6 +160,7 @@ def _create_gw_entities(self, appl: Munch) -> None: "model_id": appl.model_id, "name": appl.name, "vendor": appl.vendor_name, + "wifi_mac_address": appl.wifi_mac_address, "zigbee_mac_address": appl.zigbee_mac, }.items(): if value is not None or key == "location": @@ -289,3 +292,28 @@ def _get_module_data( break return module_data + + def _create_special_dicts( + self, item: str, data: GwEntityData, temp_dict: ActuatorData + ) -> tuple[str, ActuatorData]: + """Update the dhw_temperature and boiler_temperature dicts with a current key.""" + if item == DHW_SETPOINT: + item = "dhw_temperature" + if DHW_SETPOINT in data["sensors"]: + data["sensors"].pop(DHW_SETPOINT) + self._count -= 1 + # Use dhw_temperature when available, otherwise use water_temperature + if "dhw_temperature" in data["sensors"]: + temp_dict["current"] = data["sensors"]["dhw_temperature"] + self._count += 1 + elif "water_temperature" in data["sensors"]: + temp_dict["current"] = data["sensors"]["water_temperature"] + self._count += 1 + + if item == "maximum_boiler_temperature": + item = "boiler_temperature" + if "water_temperature" in data["sensors"]: + temp_dict["current"] = data["sensors"]["water_temperature"] + self._count += 1 + + return item, temp_dict diff --git a/plugwise/constants.py b/plugwise/constants.py index 267f2cbdb..12c54b698 100644 --- a/plugwise/constants.py +++ b/plugwise/constants.py @@ -181,6 +181,7 @@ ), # Available with the Loria and Elga (newer Anna firmware) heatpumps "cooling_state": UOM(NONE), "domestic_hot_water_mode": DATA("select_dhw_mode", NONE), + "domestic_hot_water_comfort_mode": DATA("select_dhw_mode", NONE), "domestic_hot_water_setpoint": UOM(TEMP_CELSIUS), "domestic_hot_water_state": DATA("dhw_state", NONE), "domestic_hot_water_temperature": DATA("dhw_temperature", TEMP_CELSIUS), @@ -257,13 +258,34 @@ ) ActuatorType = Literal[ "domestic_hot_water_setpoint", - "max_dhw_temperature", "maximum_boiler_temperature", + "max_dhw_temperature", "temperature_offset", "thermostat", ] ACTIVE_ACTUATORS: Final[tuple[str, ...]] = get_args(ActuatorType) +PresetTemperatureType = Literal[ + "home_preset_temperature", + "asleep_preset_temperature", + "away_preset_temperature", + "vacation_preset_temperature", + "no_frost_preset_temperature", +] +PRESET_TEMPERATURES: Final[dict[PresetTemperatureType, str]] = { + "home_preset_temperature": "home", + "asleep_preset_temperature": "asleep", + "away_preset_temperature": "away", + "vacation_preset_temperature": "vacation", + "no_frost_preset_temperature": "no_frost", +} +PRESET_TEMPERATURE_RESOLUTION: Final[float] = 0.5 +PRESET_SETPOINT_ATTRIBUTES: Final[dict[str, str]] = { + "setpoint": "heating_setpoint", + "setpoint_low": "heating_setpoint", + "setpoint_high": "cooling_setpoint", +} + ACTIVE_KEYS: Final[tuple[str, ...]] = ( "control_state", "lower_bound", @@ -276,6 +298,7 @@ ActuatorDataType = Literal[ "control_state", + "current", "lower_bound", "regulation_control", "resolution", @@ -296,6 +319,7 @@ "model_id", "name", "vendor", + "wifi_mac_address", "zigbee_mac_address", ] @@ -379,7 +403,6 @@ "c_heating_state", "thermostat_supports_cooling", ] - SPECIALS: Final[tuple[str, ...]] = get_args(SpecialType) SPECIAL_FORMAT: Final[tuple[str, ...]] = (ENERGY_KILO_WATT_HOUR, VOLUME_CUBIC_METERS) @@ -523,6 +546,7 @@ class ActuatorData(TypedDict, total=False): """Actuator data for thermostat types.""" control_state: str + current: float lower_bound: float regulation_control: str resolution: float @@ -549,6 +573,7 @@ class GwEntityData(TypedDict, total=False): model_id: str | None name: str vendor: str + wifi_mac_address: str zigbee_mac_address: str # For temporary use @@ -561,9 +586,10 @@ class GwEntityData(TypedDict, total=False): # Device availability available: bool | None - # Loria - select_dhw_mode: str + # DHW mode related + dhw_mode: str dhw_modes: list[str] + select_dhw_mode: str # Gateway gateway_modes: list[str] @@ -579,9 +605,14 @@ class GwEntityData(TypedDict, total=False): # Presets: active_preset: str | None preset_modes: list[str] | None + home_preset_temperature: ActuatorData + asleep_preset_temperature: ActuatorData + away_preset_temperature: ActuatorData + vacation_preset_temperature: ActuatorData + no_frost_preset_temperature: ActuatorData # Schedules: available_schedules: list[str] - select_schedule: str | None + select_schedule: str climate_mode: str # Extra for Adam Master Thermostats @@ -589,6 +620,8 @@ class GwEntityData(TypedDict, total=False): # Dict-types binary_sensors: SmileBinarySensors + boiler_temperature: ActuatorData + dhw_temperature: ActuatorData max_dhw_temperature: ActuatorData maximum_boiler_temperature: ActuatorData sensors: SmileSensors diff --git a/plugwise/data.py b/plugwise/data.py index eb244f0f1..56de13064 100644 --- a/plugwise/data.py +++ b/plugwise/data.py @@ -12,8 +12,9 @@ ANNA, MAX_SETPOINT, MIN_SETPOINT, - NONE, OFF, + PRESET_TEMPERATURE_RESOLUTION, + PRESET_TEMPERATURES, ActuatorData, GwEntityData, ) @@ -78,6 +79,14 @@ def _update_gw_entities(self) -> None: remove_empty_platform_dicts(entity) + # Replace select_dhw_mode with dhw_mode when applicable + if ( + "dhw_temperature" in entity + and (mode := entity.get("select_dhw_mode")) is not None + ): + entity.pop("select_dhw_mode") + entity["dhw_mode"] = mode + def _detect_low_batteries(self) -> list[str]: """Helper-function updating the low-battery binary_sensor status from a Battery-is-low message.""" mac_address_list: list[str] = [] @@ -259,6 +268,8 @@ def _climate_data(self, location_id: str, entity: GwEntityData) -> None: if entity.get("location") is not None: loc_id = entity["location"] + zone_cools = self._cooling_present and self._cooling_allowed(loc_id) + # Presets entity["preset_modes"] = None entity["active_preset"] = None @@ -266,22 +277,25 @@ def _climate_data(self, location_id: str, entity: GwEntityData) -> None: if presets := self._presets(loc_id): entity["preset_modes"] = list(presets) entity["active_preset"] = self._preset(loc_id) + # Only a zone's own rule can be edited without touching other zones + if self._preset_rule_id(loc_id) is not None: + self._preset_temperatures(zone_cools, presets, entity) # Schedule - entity["available_schedules"] = [] - entity["select_schedule"] = None + entity["available_schedules"] = [OFF] + entity["select_schedule"] = OFF self._count += 2 avail_schedules, sel_schedule = self._schedules(loc_id) - if avail_schedules != [NONE]: + if avail_schedules != [OFF]: entity["available_schedules"] = avail_schedules entity["select_schedule"] = sel_schedule # Set HA climate HVACMode: auto, heat, heat_cool, cool and off entity["climate_mode"] = "auto" self._count += 1 - if sel_schedule in (NONE, OFF): + if sel_schedule == OFF: entity["climate_mode"] = "heat" - if self._cooling_present: + if zone_cools: entity["climate_mode"] = ( "cool" if self.check_reg_mode("cooling") else "heat_cool" ) @@ -289,10 +303,38 @@ def _climate_data(self, location_id: str, entity: GwEntityData) -> None: if self.check_reg_mode("off"): entity["climate_mode"] = "off" - if NONE not in avail_schedules: - self._get_schedule_states_with_off( - loc_id, avail_schedules, sel_schedule, entity - ) + self._get_schedule_states_with_off( + loc_id, avail_schedules, sel_schedule, entity + ) + + def _preset_temperatures( + self, zone_cools: bool, presets: dict[str, list[float]], entity: GwEntityData + ) -> None: + """Helper-function for _climate_data(). + + Add the setpoints of each preset as an adjustable value: the heating setpoint, + or where the zone may cool the heating (low) and cooling (high) setpoints. + """ + for key, preset in PRESET_TEMPERATURES.items(): + if preset in presets: + heating, cooling = presets[preset] + if zone_cools: + entity[key] = ActuatorData( + lower_bound=MIN_SETPOINT, + resolution=PRESET_TEMPERATURE_RESOLUTION, + setpoint_high=cooling, + setpoint_low=heating, + upper_bound=MAX_SETPOINT, + ) + self._count += 5 + else: + entity[key] = ActuatorData( + lower_bound=MIN_SETPOINT, + resolution=PRESET_TEMPERATURE_RESOLUTION, + setpoint=heating, + upper_bound=MAX_SETPOINT, + ) + self._count += 4 def check_reg_mode(self, mode: str) -> bool: """Helper-function for device_data_climate().""" @@ -318,15 +360,12 @@ def _get_anna_control_state(self, data: GwEntityData) -> None: def _get_schedule_states_with_off( self, location: str, schedules: list[str], selected: str, entity: GwEntityData ) -> None: - """Collect schedules with states for each thermostat. - - Also, replace NONE by OFF when none of the schedules are active. - """ + """Collect schedules with states for each thermostat.""" all_off = True self._schedule_old_states[location] = {} for schedule in schedules: - active: bool = schedule == selected and entity["climate_mode"] == "auto" self._schedule_old_states[location][schedule] = "off" + active: bool = schedule == selected and entity["climate_mode"] == "auto" if active: self._schedule_old_states[location][schedule] = "on" all_off = False diff --git a/plugwise/helper.py b/plugwise/helper.py index 075f5b17d..5ea6b73e5 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -18,7 +18,6 @@ ATTR_NAME, DATA, DEVICE_MEASUREMENTS, - DHW_SETPOINT, DOMAIN_OBJECTS, ENERGY_WATT_HOUR, GROUP_MEASUREMENTS, @@ -79,6 +78,11 @@ def search_actuator_functionalities( return None +def _own_rule_ids(rules: dict[str, dict[str, str]], loc_id: str) -> list[str]: + """Return the ids of the rules attached to loc_id.""" + return [rule_id for rule_id, data in rules.items() if data["location"] == loc_id] + + class SmileHelper(SmileCommon): """The SmileHelper class.""" @@ -87,6 +91,7 @@ def __init__(self) -> None: super().__init__() self._endpoint: str self._elga: bool + self._dhw_allowed_modes: list[str] | None = None self._is_thermostat: bool self._loc_data: dict[str, ThermoLoc] self._schedule_old_states: dict[str, dict[str, str]] @@ -127,6 +132,7 @@ def _get_appliances(self) -> None: appl.module_id = None appl.name = appliance.find("name").text appl.pwclass = appliance.find("type").text + appl.wifi_mac_address = None appl.zigbee_mac = None appl.vendor_name = None @@ -191,6 +197,7 @@ def _get_p1_smartmeter_info(self) -> None: appl.name = "P1" appl.pwclass = "smartmeter" appl.vendor_name = module_data["vendor_name"] + appl.wifi_mac_address = None appl.zigbee_mac = None # Replace the entity_id of the gateway by the smartmeter location_id @@ -242,9 +249,8 @@ def _appliance_info_finder(self, appl: Munch, appliance: etree.Element) -> Munch appl := self._appl_heater_central_info(appl, appliance, False) ): # False means non-legacy entity return Munch() - self._dhw_allowed_modes = self._get_appl_actuator_modes( - appliance, "domestic_hot_water_mode_control_functionality" - ) + self._collect_dhw_modes(appliance) + return appl case _ as s if s.endswith("_plug"): # Collect info from plug-types (Plug, Aqara Smart Plug) @@ -265,6 +271,20 @@ def _appliance_info_finder(self, appl: Munch, appliance: etree.Element) -> Munch case _: # pragma: no cover return Munch() + def _collect_dhw_modes(self, appliance: etree.Element) -> None: + """Collect the DHW modes.""" + # Collect the Loria dhw modes + self._dhw_allowed_modes = self._get_appl_actuator_modes( + appliance, "domestic_hot_water_mode_control_functionality" + ) + # Determine the dhw modes from the domestic_hot_water_comfort_mode toggle + if self._dhw_allowed_modes: + return + + self._get_toggle_state( + appliance, "domestic_hot_water_comfort_mode", "dhw_cm_switch", {} + ) + def _appl_gateway_info(self, appl: Munch, appliance: etree.Element) -> Munch: """Helper-function for _appliance_info_finder().""" self._gateway_id = appl.entity_id @@ -276,6 +296,7 @@ def _appl_gateway_info(self, appl: Munch, appliance: etree.Element) -> Munch: appl.model_id = self.smile.model_id appl.name = self.smile.name appl.vendor_name = "Plugwise" + appl.wifi_mac_address = self.smile.wifi_mac_address # Adam: collect the ZigBee MAC address of the Smile if self.check_name(ADAM): @@ -351,7 +372,7 @@ def _get_measurement_data(self, entity_id: str, entity: GwEntityData) -> None: measurements = DEVICE_MEASUREMENTS if self._is_thermostat and entity_id == self.heater_id: measurements = HEATER_CENTRAL_MEASUREMENTS - # Show the allowed dhw_modes (Loria only) + # Show the available dhw_modes if self._dhw_allowed_modes: data["dhw_modes"] = self._dhw_allowed_modes # Counting of this item is done in _appliance_measurements() @@ -407,6 +428,7 @@ def _collect_appliance_data( if ( appliance := self._domain_objects.find(f'./appliance[@id="{entity_id}"]') ) is not None: + # Collect the cooling enabled toggle state self._appliance_measurements(appliance, data, measurements) self._get_lock_state(appliance, data) @@ -451,6 +473,7 @@ def _appliance_measurements( if skip_obsolete_measurements(appliance, measurement): continue + old_measurement = measurement if new_name := getattr(attrs, ATTR_NAME, None): measurement = new_name @@ -458,8 +481,7 @@ def _appliance_measurements( case "elga_status_code": data["elga_status_code"] = int(appl_p_loc.text) case "select_dhw_mode": - if self._dhw_allowed_modes: - data["select_dhw_mode"] = appl_p_loc.text + self._select_dhw_mode(appl_p_loc.text, data, old_measurement) common_match_cases(measurement, attrs, appl_p_loc, data) @@ -472,8 +494,19 @@ def _appliance_measurements( self._count = count_data_items(self._count, data) + def _select_dhw_mode(self, text: str, data: GwEntityData, measurement: str) -> None: + """Set the selected dhw mode.""" + if self._dhw_allowed_modes and "select_dhw_mode" not in data: + data["select_dhw_mode"] = text + if measurement == "domestic_hot_water_comfort_mode": + data["select_dhw_mode"] = "comfort" if text == "on" else "eco" + def _get_toggle_state( - self, xml: etree.Element, toggle: str, name: ToggleNameType, data: GwEntityData + self, + xml: etree.Element, + toggle: str, + name: ToggleNameType, + data: GwEntityData, ) -> None: """Helper-function for _get_measurement_data(). @@ -482,8 +515,14 @@ def _get_toggle_state( if xml.find("type").text == "heater_central": locator = f"./actuator_functionalities/toggle_functionality[type='{toggle}']/state" if (state := xml.find(locator)) is not None: - data["switches"][name] = state.text == "on" - self._count += 1 + if "switches" in data: + data["switches"][name] = state.text == "on" + self._count += 1 + if ( + not self._dhw_allowed_modes + and toggle == "domestic_hot_water_comfort_mode" + ): + self._dhw_allowed_modes = ["comfort", "eco"] def _get_plugwise_notifications(self) -> None: """Collect the Plugwise notifications.""" @@ -557,14 +596,7 @@ def _get_actuator_functionalities( temp_dict[act_key] = str(pw_function.text) if temp_dict: - # If domestic_hot_water_setpoint is present as actuator, - # rename and remove as sensor - if item == DHW_SETPOINT: - item = "max_dhw_temperature" - if DHW_SETPOINT in data["sensors"]: - data["sensors"].pop(DHW_SETPOINT) - self._count -= 1 - + item, temp_dict = self._create_special_dicts(item, data, temp_dict) act_item = cast(ActuatorType, item) data[act_item] = temp_dict @@ -888,14 +920,27 @@ def _preset(self, loc_id: str) -> str | None: return None # pragma: no cover + def _cooling_allowed(self, loc_id: str) -> bool: + """Helper-function for data.py: _climate_data() and smile.py: set_preset_temperature(). + + Collect whether cooling is allowed in a zone, based on Location ID. + Assume it is where the zone says nothing, leaving the gateway-wide + capability to decide. + """ + locator = ( + f'./location[@id="{loc_id}"]/actuator_functionalities' + "/thermostat_functionality/cooling_allowed" + ) + if (allowed := self._domain_objects.find(locator)) is not None: + return str(allowed.text) == "true" + + return True + def _presets(self, loc_id: str) -> dict[str, list[float]]: """Collect Presets for a Thermostat based on location_id.""" presets: dict[str, list[float]] = {} - tag_1 = "zone_setpoint_and_state_based_on_preset" - tag_2 = "Thermostat presets" - if not (rule_ids := self._rule_ids_by_tag(tag_1, loc_id)): - if not (rule_ids := self._rule_ids_by_name(tag_2, loc_id)): - return presets # pragma: no cover + if not (rule_ids := self._preset_rule_ids(loc_id)): + return presets # pragma: no cover for rule_id in rule_ids: directives = self._domain_objects.find(f'rule[@id="{rule_id}"]/directives') @@ -908,6 +953,40 @@ def _presets(self, loc_id: str) -> dict[str, list[float]]: return presets + def _preset_rule_ids(self, loc_id: str) -> list[str]: + """Helper-function for _presets(). + + Read only the preset rule attached to loc_id, so each zone gets its own presets. + Fall back to all preset rules when none or several are attached. + """ + if (rule_id := self._preset_rule_id(loc_id)) is not None: + return [rule_id] + + return list(self._all_preset_rules(loc_id)) + + def _preset_rule_id(self, loc_id: str) -> str | None: + """Return the id of the one preset rule attached to loc_id, or None.""" + own = _own_rule_ids(self._all_preset_rules(loc_id), loc_id) + return own[0] if len(own) == 1 else None + + def _all_preset_rules(self, loc_id: str) -> dict[str, dict[str, str]]: + """Collect all preset rules, choosing tagged or named rules per zone. + + Use the rules found by name when loc_id has no tagged rule of its own but does + have a rule by name, or when there are no tagged rules at all. + """ + tag_1 = "zone_setpoint_and_state_based_on_preset" + tag_2 = "Thermostat presets" + tagged = self._rule_ids_by_tag(tag_1, loc_id) + if _own_rule_ids(tagged, loc_id): + return tagged + + named = self._rule_ids_by_name(tag_2, loc_id) + if _own_rule_ids(named, loc_id) or not tagged: + return named + + return tagged + def _rule_ids_by_name(self, name: str, loc_id: str) -> dict[str, dict[str, str]]: """Helper-function for _presets(). @@ -916,18 +995,15 @@ def _rule_ids_by_name(self, name: str, loc_id: str) -> dict[str, dict[str, str]] schedule_ids: dict[str, dict[str, str]] = {} locator = f'./contexts/context/zone/location[@id="{loc_id}"]' for rule in self._domain_objects.findall(f'./rule[name="{name}"]'): - active = rule.find("active").text if rule.find(locator) is not None: schedule_ids[rule.get("id")] = { "location": loc_id, "name": name, - "active": active, } else: schedule_ids[rule.get("id")] = { "location": NONE, "name": name, - "active": active, } return schedule_ids @@ -943,18 +1019,15 @@ def _rule_ids_by_tag(self, tag: str, loc_id: str) -> dict[str, dict[str, str]]: for rule in self._domain_objects.findall("./rule"): if rule.find(locator1) is not None: name = rule.find("name").text - active = rule.find("active").text if rule.find(locator2) is not None: schedule_ids[rule.get("id")] = { "location": loc_id, "name": name, - "active": active, } else: schedule_ids[rule.get("id")] = { "location": NONE, "name": name, - "active": active, } return schedule_ids @@ -965,16 +1038,15 @@ def _schedules(self, location: str) -> tuple[list[str], str]: Obtain the available schedules/schedules. Adam: a schedule can be connected to more than one location. NEW: when a location_id is present then the schedule is active. Valid for both Adam and non-legacy Anna. """ - available: list[str] = [NONE] + available: list[str] = [OFF] rule_ids: dict[str, dict[str, str]] = {} - selected = NONE + selected = OFF tag = "zone_preset_based_on_time_and_presence_with_override" if not (rule_ids := self._rule_ids_by_tag(tag, location)): return available, selected schedules: list[str] = [] for rule_id, data in rule_ids.items(): - active = data["active"] == "true" name = data["name"] locator = f'./rule[@id="{rule_id}"]/directives' # Show an empty schedule as no schedule found @@ -982,16 +1054,10 @@ def _schedules(self, location: str) -> tuple[list[str], str]: continue # pragma: no cover available.append(name) - if location == data["location"] and active: + if location == data["location"]: selected = name schedules.append(name) - if schedules: - available.remove(NONE) - available.append(OFF) - if selected == NONE: - selected = OFF - return available, selected def _thermostat_uri(self, loc_id: str) -> str: diff --git a/plugwise/legacy/data.py b/plugwise/legacy/data.py index ace3fa135..4897bb80c 100644 --- a/plugwise/legacy/data.py +++ b/plugwise/legacy/data.py @@ -7,7 +7,7 @@ # Dict as class # Version detection -from plugwise.constants import NONE, OFF, GwEntityData +from plugwise.constants import OFF, GwEntityData from plugwise.legacy.helper import SmileLegacyHelper from plugwise.util import remove_empty_platform_dicts @@ -63,18 +63,18 @@ def _climate_data(self, entity: GwEntityData) -> None: entity["active_preset"] = self._preset() # Schedule - entity["available_schedules"] = [] - entity["select_schedule"] = None + entity["available_schedules"] = [OFF] + entity["select_schedule"] = OFF self._count += 2 avail_schedules, sel_schedule = self._schedules() - if avail_schedules != [NONE]: + if avail_schedules != [OFF]: entity["available_schedules"] = avail_schedules entity["select_schedule"] = sel_schedule # Set HA climate HVACMode: auto, heat entity["climate_mode"] = "auto" self._count += 1 - if sel_schedule in (NONE, OFF): + if sel_schedule == OFF: entity["climate_mode"] = "heat" def _get_anna_control_state(self, entity: GwEntityData) -> None: diff --git a/plugwise/legacy/helper.py b/plugwise/legacy/helper.py index 4f3c806c3..22358bda6 100644 --- a/plugwise/legacy/helper.py +++ b/plugwise/legacy/helper.py @@ -110,6 +110,7 @@ def _get_appliances(self) -> None: appl.model_id = None appl.name = appliance.find("name").text appl.vendor_name = None + appl.wifi_mac_address = None appl.zigbee_mac = None # Skip thermostats that have this key, should be an orphaned device (Core #81712) @@ -241,6 +242,7 @@ def _p1_smartmeter_info_finder(self, appl: Munch) -> None: appl.model_id = None appl.name = "P1" appl.pwclass = "smartmeter" + appl.wifi_mac_address = None appl.zigbee_mac = None location = self._locations.find(f'./location[@id="{loc_id}"]') appl = self._energy_entity_info_finder(location, appl) @@ -273,7 +275,7 @@ def _get_measurement_data(self, entity_id: str, entity: GwEntityData) -> None: self._get_lock_state(appliance, data, self._stretch_v2) if appliance.find("type").text in ACTUATOR_CLASSES: - self._get_actuator_functionalities(appliance, entity, data) + self._get_actuator_functionalities(appliance, data) # Anna: the Smile outdoor_temperature is present in the Home location # For some Anna's LOCATIONS is empty, falling back to domain_objects! @@ -342,17 +344,12 @@ def _appliance_measurements( self._count = count_data_items(self._count, data) def _get_actuator_functionalities( - self, xml: etree.Element, entity: GwEntityData, data: GwEntityData + self, + xml: etree.Element, + data: GwEntityData, ) -> None: """Helper-function for _get_measurement_data().""" for item in ACTIVE_ACTUATORS: - # Skip max_dhw_temperature, not initially valid, - # skip thermostat for thermo_sensors - if item == "max_dhw_temperature" or ( - item == "thermostat" and entity["dev_class"] == "thermo_sensor" - ): - continue - temp_dict: ActuatorData = {} functionality = "thermostat_functionality" @@ -373,6 +370,7 @@ def _get_actuator_functionalities( self._count += 1 if temp_dict: + item, temp_dict = self._create_special_dicts(item, data, temp_dict) act_item = cast(ActuatorType, item) data[act_item] = temp_dict @@ -409,8 +407,8 @@ def _presets(self) -> dict[str, list[float]]: def _schedules(self) -> tuple[list[str], str]: """Collect the schedule for the legacy thermostat.""" - available: list[str] = [NONE] - rule_id = selected = NONE + available: list[str] = [OFF] + rule_id = selected = OFF name: str | None = None search = self._domain_objects @@ -429,7 +427,7 @@ def _schedules(self) -> tuple[list[str], str]: search.find(f'./rule[@id="{rule_id}"]/directives/when/then') is not None ) if directives and name is not None: - available = [name, OFF] + available = [OFF, name] selected = name if active else OFF return available, selected diff --git a/plugwise/legacy/smile.py b/plugwise/legacy/smile.py index 89e582256..841d95fb9 100644 --- a/plugwise/legacy/smile.py +++ b/plugwise/legacy/smile.py @@ -131,7 +131,13 @@ async def delete_notification(self) -> None: async def reboot_gateway(self) -> None: """Set-function placeholder for legacy devices.""" - async def set_dhw_mode(self, mode: str) -> None: + async def set_dhw_mode( + self, + key: str, + location: str, + mode: str, + length: int | str | None, + ) -> None: """Set-function placeholder for legacy devices.""" async def set_gateway_mode(self, mode: str) -> None: @@ -142,6 +148,7 @@ async def set_number( dev_id: str, key: str, temperature: float, + setpoint: str = "setpoint", ) -> None: """Set-function placeholder for legacy devices.""" @@ -151,15 +158,15 @@ async def set_offset(self, dev_id: str, offset: float) -> None: async def set_preset(self, _: str, preset: str) -> None: """Set the given Preset on the relevant Thermostat - from DOMAIN_OBJECTS.""" if not (presets := self._presets()): - raise PlugwiseError("Plugwise: no presets available.") # pragma: no cover + raise PlugwiseError("Plugwise: no presets available") # pragma: no cover if preset not in list(presets): - raise PlugwiseError("Plugwise: invalid preset.") + raise PlugwiseError(f"Plugwise: invalid preset {preset}") locator = f'rule/directives/when/then[@icon="{preset}"].../.../...' if (rule := self._domain_objects.find(locator)) is None: - raise PlugwiseError("Plugwise: no preset rule found.") # pragma: no cover + raise PlugwiseError("Plugwise: no preset rule found") # pragma: no cover if (rule_id := rule.get("id")) is None: - raise PlugwiseError("Plugwise: no preset id found.") # pragma: no cover + raise PlugwiseError("Plugwise: no preset id found") # pragma: no cover data = f"true" await self.call_request(RULES, method="put", data=data) @@ -168,14 +175,21 @@ async def set_regulation_mode(self, mode: str) -> None: """Set-function placeholder for legacy devices.""" async def set_select( - self, key: str, loc_id: str, option: str, state: str | None + self, + _: str, + loc_id: str, + option: str, + state: int | str | None = None, ) -> None: """Set the thermostat schedule option.""" # schedule name corresponds to select option - await self.set_schedule_state("dummy", state, option) + await self.set_schedule_state("loc_id", option, state=state) async def set_schedule_state( - self, _: str, state: str | None, name: str | None + self, + _: str, + name: str | None = None, + state: int | str | None = None, ) -> None: """Activate/deactivate the Schedule. @@ -183,7 +197,7 @@ async def set_schedule_state( Used in HA Core to set the hvac_mode: in practice switch between schedule on - off. """ if state not in (STATE_OFF, STATE_ON): - raise PlugwiseError("Plugwise: invalid schedule state.") + raise PlugwiseError(f"Plugwise: invalid schedule state {state}") # Handle no schedule-name / Off-schedule provided if name is None or name == OFF: @@ -197,7 +211,7 @@ async def set_schedule_state( if schedule_rule_id is None: raise PlugwiseError( - "Plugwise: no schedule with this name available." + f"Plugwise: no schedule with name {name} available" ) # pragma: no cover new_state = "false" @@ -221,7 +235,7 @@ async def set_schedule_state( async def set_switch_state( self, appl_id: str, members: list[str] | None, model: str, state: str - ) -> bool: + ) -> bool | None: """Set the given state of the relevant switch. For individual switches, sets the state directly. @@ -229,7 +243,7 @@ async def set_switch_state( For switch-locks, sets the lock state using a different data format. Return the requested state when successful, the current state otherwise. """ - current_state = self.gw_entities[appl_id]["switches"]["relay"] + current_state = self.gw_entities[appl_id]["switches"].get("relay") requested_state = state == STATE_ON switch = Munch() switch.actuator = "actuator_functionalities" diff --git a/plugwise/smile.py b/plugwise/smile.py index 6acb4233a..3337b0602 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -5,9 +5,11 @@ from __future__ import annotations +import asyncio from collections.abc import Awaitable, Callable import datetime as dt from typing import Any, cast +from xml.sax.saxutils import quoteattr from plugwise.constants import ( ALLOWED_ZONE_PROFILES, @@ -21,6 +23,8 @@ NONE, NOTIFICATIONS, OFF, + PRESET_SETPOINT_ATTRIBUTES, + PRESET_TEMPERATURES, RULES, STATE_OFF, STATE_ON, @@ -37,22 +41,26 @@ from munch import Munch +def _xml_attrs(attrs: dict[str, str]) -> str: + """Return XML attributes, with escaped values.""" + return " ".join(f"{key}={quoteattr(value)}" for key, value in attrs.items()) + + def model_to_switch_items(model: str, state: str, switch: Munch) -> tuple[str, Munch]: """Translate state and switch attributes based on model name. Helper function for set_switch_state(). """ match model: - case "dhw_cm_switch": - switch.device = "toggle" - switch.func_type = "toggle_functionality" + case "select_dhw_mode" | "dhw_mode" | "dhw_cm_switch": + switch.device = switch.func_type = "toggle" switch.act_type = "domestic_hot_water_comfort_mode" case "cooling_ena_switch": - switch.device = "toggle" - switch.func_type = "toggle_functionality" + switch.device = switch.func_type = "toggle" switch.act_type = "cooling_enabled" case "lock": switch.func = "lock" + switch.method = "post" state = "true" if state == STATE_ON else "false" return state, switch @@ -87,6 +95,7 @@ def __init__( self._schedule_old_states = _schedule_old_states self.smile = smile self.therms_with_offset_func: list[str] = [] + self._preset_lock = asyncio.Lock() @property def cooling_present(self) -> bool: @@ -170,13 +179,28 @@ async def set_number( dev_id: str, key: str, temperature: float, + setpoint: str = "setpoint", ) -> None: - """Set the maximum boiler- or DHW-setpoint on the Central Heating boiler or the temperature-offset on a Thermostat.""" + """Set the boiler- or DHW-setpoint on the Central Heating boiler, the temperature-offset on a Thermostat or a preset temperature. + + For a preset temperature, setpoint picks the heating (setpoint, setpoint_low) or cooling (setpoint_high) value. + """ + if key in PRESET_TEMPERATURES: + if (attribute := PRESET_SETPOINT_ATTRIBUTES.get(setpoint)) is None: + raise PlugwiseError(f"Plugwise: invalid preset setpoint {setpoint}") + # An Adam zone is its own location, an Anna thermostat has one + loc_id = self.gw_entities[dev_id].get("location", dev_id) + preset = PRESET_TEMPERATURES[key] + await self.set_preset_temperature(loc_id, preset, temperature, attribute) + return + match key: case "temperature_offset": await self.set_offset(dev_id, temperature) return - case "max_dhw_temperature": + case "boiler_temperature": + key = "maximum_boiler_temperature" + case "dhw_temperature": key = "domestic_hot_water_setpoint" temp = str(temperature) @@ -188,7 +212,7 @@ async def set_number( thermostat_id = th_func.get("id") if thermostat_id is None: - raise PlugwiseError(f"Plugwise: cannot change setpoint, {key} not found.") + raise PlugwiseError(f"Plugwise: cannot change setpoint, {key} not found") data = ( "" @@ -202,7 +226,7 @@ async def set_offset(self, dev_id: str, offset: float) -> None: """Set the Temperature offset for thermostats that support this feature.""" if dev_id not in self.therms_with_offset_func: raise PlugwiseError( - "Plugwise: this device does not have temperature-offset capability." + "Plugwise: this device does not have temperature-offset capability" ) value = str(offset) @@ -210,12 +234,81 @@ async def set_offset(self, dev_id: str, offset: float) -> None: uri = f"{APPLIANCES};id={dev_id}/offset;type=temperature_offset" await self.call_request(uri, method="put", data=data) + async def set_preset_temperature( + self, + loc_id: str, + preset: str, + temperature: float, + attribute: str = "heating_setpoint", + ) -> None: + """Set the heating or cooling setpoint of one preset in the zone's preset rule. + + The gateway re-applies the zone's active preset, which resets a manual setpoint. + """ + if (rule_id := self._preset_rule_id(loc_id)) is None: + raise PlugwiseError("Plugwise: this zone has no preset rule of its own") + + locator = f'rule[@id="{rule_id}"]/directives/when[@preset="{preset}"]/then' + if (then := self._domain_objects.find(locator)) is None: + raise PlugwiseError(f"Plugwise: invalid preset {preset}") + if not MIN_SETPOINT <= temperature <= MAX_SETPOINT: + raise PlugwiseError( + f"Plugwise: preset temperature must be between {MIN_SETPOINT} and {MAX_SETPOINT}" + ) + + # The gateway replaces the whole directive set, so every preset is sent. + # The lock keeps a concurrent write from resending a stale value for another preset. + async with self._preset_lock: + heating = float(then.get("heating_setpoint")) + cooling = float(then.get("cooling_setpoint")) + if attribute == "heating_setpoint": + heating = temperature + else: + cooling = temperature + # Where a zone may not cool, the stored cooling setpoint is a default nobody can change + if ( + self._cooling_present + and self._cooling_allowed(loc_id) + and heating > cooling + ): + raise PlugwiseError( + f"Plugwise: the {preset} heating setpoint {heating} is above its cooling setpoint {cooling}. Lower the heating setpoint or raise the cooling setpoint." + ) + + value = str(temperature) + directives = "" + for when in self._domain_objects.findall( + f'rule[@id="{rule_id}"]/directives/when' + ): + if (when_then := when.find("then")) is None: + raise PlugwiseError( + f"Plugwise: preset rule {rule_id} has a switch point without settings" + ) + then_attrs = dict(when_then.attrib) + if when.get("preset") == preset: + then_attrs[attribute] = value + directives += ( + f"" + f"" + ) + + data = ( + "" + f"" + f"{directives}" + "" + "" + ) + await self.call_request(f"{RULES};id={rule_id}", method="put", data=data) + for then in self._domain_objects.findall(locator): + then.set(attribute, value) + async def set_preset(self, loc_id: str, preset: str) -> None: """Set the given Preset on the relevant Thermostat - from LOCATIONS.""" if (presets := self._presets(loc_id)) is None: - raise PlugwiseError("Plugwise: no presets available.") # pragma: no cover + raise PlugwiseError("Plugwise: no presets available") # pragma: no cover if preset not in list(presets): - raise PlugwiseError("Plugwise: invalid preset.") + raise PlugwiseError(f"Plugwise: invalid preset {preset}") current_location = self._domain_objects.find(f'location[@id="{loc_id}"]') location_name = current_location.find("name").text @@ -233,39 +326,68 @@ async def set_preset(self, loc_id: str, preset: str) -> None: await self.call_request(uri, method="put", data=data) async def set_select( - self, key: str, loc_id: str, option: str, state: str | None + self, + key: str, + appl_or_loc_id: str, + option: str, + state: int | str | None = None, ) -> None: """Set a dhw/gateway/regulation mode or the thermostat schedule option.""" match key: - case "select_dhw_mode": - await self.set_dhw_mode(option) + case "select_dhw_mode" | "dhw_mode": + state = STATE_ON if option == "comfort" else STATE_OFF + # Appliance id is passed + await self.set_switch_state(appl_or_loc_id, None, key, state) case "select_gateway_mode": await self.set_gateway_mode(option) case "select_regulation_mode": await self.set_regulation_mode(option) case "select_schedule": - # schedule name corresponds to select option - await self.set_schedule_state(loc_id, state, option) + # The schedule name corresponds to the select option + # Location id is passed + await self.set_schedule_state(appl_or_loc_id, option, state=state) case "select_zone_profile": - await self.set_zone_profile(loc_id, option) + # Location id is passed + await self.set_zone_profile(appl_or_loc_id, option) - async def set_dhw_mode(self, mode: str) -> None: - """Set the domestic hot water heating regulation mode.""" - if mode not in self._dhw_allowed_modes: - raise PlugwiseError("Plugwise: invalid dhw mode.") + async def set_dhw_mode( + self, key: str, appl_id: str, mode: str, length: int | str | None = None + ) -> None: + """Set the domestic hot water mode. - data = ( - "" - f"{mode}" - "" - ) - uri = f"{APPLIANCES};type=heater_central/domestic_hot_water_mode_control" - await self.call_request(uri, method="put", data=data) + Two options are known: + - 2 modes, comfort and off, representing the dhw comfort mode on and off switch states, + - and the 5 modes available on the Loria. + """ + if ( + mode not in self.gw_entities.get(appl_id, {}).get("dhw_modes", []) + or length is None + or not isinstance(length, int) + ): + raise PlugwiseError( + f"Plugwise: invalid dhw mode {mode} or invalid length {length}" + ) + + match length: + case 2: + await self.set_select(key, appl_id, mode) + case _: + data = ( + "" + f"{mode}" + "" + ) + uri = ( + f"{APPLIANCES};type=heater_central/domestic_hot_water_mode_control" + ) + await self.call_request(uri, method="put", data=data) async def set_gateway_mode(self, mode: str) -> None: """Set the gateway mode.""" - if mode not in self._gw_allowed_modes: - raise PlugwiseError("Plugwise: invalid gateway mode.") + if mode not in self.gw_entities.get(self.gateway_id, {}).get( + "gateway_modes", [] + ): + raise PlugwiseError(f"Plugwise: invalid gateway mode {mode}") end_time = "2037-04-21T08:00:53.000Z" valid = "" @@ -296,8 +418,10 @@ async def set_gateway_mode(self, mode: str) -> None: async def set_regulation_mode(self, mode: str) -> None: """Set the heating regulation mode.""" - if mode not in self._reg_allowed_modes: - raise PlugwiseError("Plugwise: invalid regulation mode.") + if mode not in self.gw_entities.get(self.gateway_id, {}).get( + "regulation_modes", [] + ): + raise PlugwiseError(f"Plugwise: invalid regulation mode {mode}") duration = "" if "bleeding" in mode: @@ -315,7 +439,7 @@ async def set_regulation_mode(self, mode: str) -> None: async def set_zone_profile(self, loc_id: str, profile: str) -> None: """Set the Adam thermoszone heating profile.""" if profile not in ALLOWED_ZONE_PROFILES: - raise PlugwiseError("Plugwise: invalid zone profile.") + raise PlugwiseError(f"Plugwise: invalid zone profile {profile}") data = ( "" @@ -326,10 +450,7 @@ async def set_zone_profile(self, loc_id: str, profile: str) -> None: await self.call_request(uri, method="post", data=data) async def set_schedule_state( - self, - loc_id: str, - new_state: str | None, - name: str | None, + self, loc_id: str, name: str | None = None, state: int | str | None = None ) -> None: """Activate/deactivate the Schedule, with the given name, on the relevant Thermostat. @@ -337,26 +458,28 @@ async def set_schedule_state( Used in HA Core to set the hvac_mode: in practice switch between schedule on - off. """ # Input checking - if new_state not in (STATE_OFF, STATE_ON): - raise PlugwiseError("Plugwise: invalid schedule state.") + if state is None: + state = STATE_ON + elif state not in (STATE_OFF, STATE_ON): + raise PlugwiseError(f"Plugwise: invalid schedule state {state}") # Translate selection of Off-schedule-option to disabling the active schedule if name == OFF: - new_state = STATE_OFF + state = STATE_OFF # Handle no schedule-name / schedule-off requested: find the active schedule if name is None or name == OFF: _, name = self._schedules(loc_id) - if name == OFF: # no active schedule found, nothing to do + if name in (NONE, OFF): # no active schedule found, nothing to do return schedule_rule = self._rule_ids_by_name(name, loc_id) # Raise an error when the schedule name does not exist if not schedule_rule or schedule_rule is None: - raise PlugwiseError("Plugwise: no schedule with this name available.") + raise PlugwiseError(f"Plugwise: no schedule with name {name} available") # If no state change is requested, do nothing - if new_state == self._schedule_old_states[loc_id][name]: + if state == self._schedule_old_states[loc_id][name]: return schedule_rule_id: str = next(iter(schedule_rule)) @@ -368,7 +491,7 @@ async def set_schedule_state( template_id = self._domain_objects.find(locator).get("id") template = f'