Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar Functionality #90

Open
ReconOperator opened this issue Sep 2, 2024 · 3 comments
Open

Calendar Functionality #90

ReconOperator opened this issue Sep 2, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@ReconOperator
Copy link

ReconOperator commented Sep 2, 2024

Noticed that there is a calendar functionality available in the Thermia Online app. Here you can set different tasks, ex block production of hot water during specific times.
Wold it be possible to add this to the integration @klejejs ?

Screenshot_20240902_140159_Thermia Online

@klejejs klejejs added the enhancement New feature or request label Dec 5, 2024
@oskari
Copy link

oskari commented Dec 11, 2024

Would be great if this could somehow be integrated. "Add calendar event" action or something similiar? The thermia online calendar doesn't support schedules (At least for me it doesn't, even if the heat pump itself does), so having an action which I could call and set EVU mode for certain high-cost hours would be fantastic for implementing spot price controlled heating to these "dumb units".

@oskari
Copy link

oskari commented Dec 11, 2024

To add some context how the (classic) api works for these:

Supported calendar actions: GET https://online-classic-serviceapi.azurewebsites.net/api/v1/installations/{installation_id}/calendarFunctions

Response:


[
  {
    "id": 15001,
    "name": "CAL_FUNCTION_REDUCED_HEATING_EFFECT",
    "recurringEnabled": false,
    "canBePaused": false,
    "hasFunctionBasedValue": false,
    "isTemperatureOverriden": true,
    "properties": {
      "type": 1,
      "value": "{\"Unit\":\"\\u00B0C\",\"Min\":10,\"Max\":30,\"Default\":20}"
    }
  },
  {
    "id": 15002,
    "name": "CAL_FUNCTION_HOT_WATER",
    "recurringEnabled": false,
    "canBePaused": false,
    "hasFunctionBasedValue": false,
    "isTemperatureOverriden": false,
    "properties": {
      "type": 0,
      "value": ""
    }
  },
  {
    "id": 15003,
    "name": "CAL_FUNCTION_SILENT_MODE",
    "recurringEnabled": false,
    "canBePaused": false,
    "hasFunctionBasedValue": false,
    "isTemperatureOverriden": false,
    "properties": {
      "type": 0,
      "value": ""
    }
  },
  {
    "id": 15004,
    "name": "CAL_FUNCTION_EVU_MODE",
    "recurringEnabled": false,
    "canBePaused": false,
    "hasFunctionBasedValue": false,
    "isTemperatureOverriden": false,
    "properties": {
      "type": 0,
      "value": ""
    }
  }
]

Setting new schedule: POST https://online-classic-serviceapi.azurewebsites.net/api/v1/installations/{installation_id}/schedules
Payload:

{
  "installationId": XXX,
  "functionId": 15003,
  "recurringType": 1,
  "recurringOccurrence": 0,
  "hasFunctionBasedValue": false,
  "start": "2024-12-11T23:00:00.000",
  "end": "2024-12-12T00:30:00.000",
  "isPaused": false
}

Response:

{
  "isRunning": false,
  "isFaulty": false,
  "id": 185449,
  "installationId": XXX,
  "functionId": 15003,
  "start": "2024-12-11T23:00:00",
  "end": "2024-12-12T00:30:00",
  "recurringType": 1,
  "recurringOccurrence": 0,
  "value": null,
  "isPaused": false
}

List current schedules: GET https://online-classic-serviceapi.azurewebsites.net/api/v1/installations/{installation_id}/schedules
Response:

[
  {
    "isRunning": false,
    "isFaulty": false,
    "id": 185449,
    "installationId": XXX,
    "functionId": 15003,
    "start": "2024-12-11T23:00:00",
    "end": "2024-12-12T00:30:00",
    "recurringType": 1,
    "recurringOccurrence": 0,
    "value": null,
    "isPaused": false
  }
]

@ReconOperator
Copy link
Author

Would be great if this could somehow be integrated. "Add calendar event" action or something similiar? The thermia online calendar doesn't support schedules (At least for me it doesn't, even if the heat pump itself does), so having an action which I could call and set EVU mode for certain high-cost hours would be fantastic for implementing spot price controlled heating to these "dumb units".

As of now i have done this:
Created a input number Helper (holds the number of hours i want to block)
Created a binary sensor (that uses Nordpool HACS integration)

{% set numberOfHours = states('input_number.geothermal_expensive_hour_input') | int  %}
{% set expensive = state_attr('sensor.nordpool_se3_no_vat','raw_today') |sort(attribute='value', reverse=true) %}
  {% for i in range(0, numberOfHours) %}
    {% if(now() > expensive[i].start and now() < expensive[i].end) %}
      True
    {% endif %}
  {% endfor %}

Then an automation with the binary sensor as trigger. When the binary sensor turns On (expensive hour is On) I call the action to turn the switch for hot water Off. When the binary sensor turns Off (expensive hour is Off) I call the action to turn the switch for hot water On.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants