JoDehli / PyLoxone

Python Loxone binding
Apache License 2.0
164 stars 40 forks source link

[Question/Feature_Request]: sensor for tempTarget (or other "nested" values) #213

Closed huliz closed 6 months ago

huliz commented 6 months ago

Describe the bug

I'm unable to find anything related to climate sensors that are nested under thermostat values. Right now I use a workaround via node-red loxone plugin - it allows to simply select the required input and then I can pass it to MQTT but it's sub-optimal.

image

I make persistent mqtt records to store the latest temp target set on Loxone and then pass it HA. Then I have a helper slider that is using your example custom api call

image

Perhaps I can't find and you can point me in the right direction? If not possible to have a sensor, is there a custom api command I could use?

Firmware of your Miniserver

13.0.6.29

HomeAssistant install method

docker

Version of HomeAssistant

2023.6.2

Version of Pyloxone

0.4.3

Update pyloxone

no

Log

Settings for the log can be found on the main page under the section Log Configuration

JoDehli commented 6 months ago

@huliz it is not a bug. The sensors with subsensors are not read. For the light controller pyloxone can read out all subcontrols and create controls for each subcontrol. But it is not done for other device types.

You can try to create custom sensors for each of the sensors which you want to see.

JoDehli commented 6 months ago

@huliz I do not know what you mean with api command? What do you want to do?

huliz commented 6 months ago

I would like to read tempTarget value from Loxone thermostat

On Mon, Nov 13, 2023, 20:56 Joachim D. @.***> wrote:

@huliz https://github.com/huliz I do not know what you mean with api command? What do you want to do?

— Reply to this email directly, view it on GitHub https://github.com/JoDehli/PyLoxone/issues/213#issuecomment-1808951380, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYMU6AIZNQEHT6UIGWKRRLYEJ3P7AVCNFSM6AAAAAA7IX3DZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBYHE2TCMZYGA . You are receiving this because you were mentioned.Message ID: @.***>

JoDehli commented 6 months ago

@huliz can you post the entire section for the thermostat from the structure file. You can hide the uuid for security.

huliz commented 6 months ago

thanks for trying to look into it, I've replaced some values with xxx and yyy. If I got it right, this is just about one room.

ideally I would just want to read the current target temperature, input it for HA thermostat and then schedule/regulate to whatever is required.

"xxx-00e2-32af-yyy": {
            "name": "Thermostat Guest Room",
            "type": "IRoomController",
            "uuidAction": "xxx-00e2-32af-yyy",
            "room": "0c4bc0a8-0275-03e8-yyy",
            "cat": "0c4bc0a8-0261-02e0-yyy",
            "defaultRating": 1,
            "isFavorite": false,
            "isSecured": false,
            "details": {
                "jLockable": true,
                "restrictedToMode": 2,
                "temperatures": {
                    "0": {
                        "isAbsolute": false
                    },
                    "1": {
                        "isAbsolute": true
                    },
                    "2": {
                        "isAbsolute": true
                    },
                    "3": {
                        "isAbsolute": true
                    },
                    "4": {
                        "isAbsolute": true
                    },
                    "5": {
                        "isAbsolute": false
                    },
                    "6": {
                        "isAbsolute": false
                    }
                },
                "format": "%.1f°"
            },
            "states": {
                "jLocked": "907111db-001d-ef4c-ffff7b344b2f377a",
                "tempTarget": "xxx-00e2-32aa-ffff1e329f4d943d",
                "tempActual": "xxx-00e2-328b-ffff1e329f4d943d",
                "error": "xxx-00e2-32a8-ffff1e329f4d943d",
                "mode": "xxx-00e2-32a6-ffff1e329f4d943d",
                "serviceMode": "xxx-00e2-32a7-ffff1e329f4d943d",
                "currHeatTempIx": "xxx-00e2-3282-ffff1e329f4d943d",
                "currCoolTempIx": "xxx-00e2-3283-ffff1e329f4d943d",
                "override": "xxx-00e2-32ad-ffff1e329f4d943d",
                "isPreparing": "xxx-00e2-32ae-ffff1e329f4d943d",
                "valveHeat": "xxx-00e2-329d-ffff1e329f4d943d",
                "valveCool": "xxx-00e2-32a1-ffff1e329f4d943d",
                "openWindow": "xxx-00e2-328c-ffff1e329f4d943d",
                "stop": "107111db-001d-ef4c-ffff7b344b2f377a",
                "overrideTotal": "0eec2b1d-0322-199c-yyy",
                "movement": "0eec2b1d-0322-199b-yyy",
                "manualMode": "0eec2b1d-0322-199d-yyy",
                "temperatures": [
                    "xxx-00e2-3292-ffff1e329f4d943d",
                    "xxx-00e2-3293-ffff1e329f4d943d",
                    "xxx-00e2-3294-ffff1e329f4d943d",
                    "xxx-00e2-3297-ffff1e329f4d943d",
                    "xxx-00e2-3298-ffff1e329f4d943d",
                    "xxx-00e2-3296-ffff1e329f4d943d",
                    "xxx-00e2-3295-ffff1e329f4d943d"
                ]
            },
            "statistic": {
                "frequency": 6,
                "outputs": [
                    {
                        "id": 0,
                        "name": "Temperature",
                        "format": "%.1f°C",
                        "uuid": "xxx-00e2-328b-ffff1e329f4d943d",
                        "visuType": 0
                    }
                ]
            },
            "subControls": {
                "xxx-00e2-3280-ffff1e329f4d943d": {
                    "name": "Heating",
                    "type": "IRCDaytimer",
                    "uuidAction": "xxx-00e2-3280-ffff1e329f4d943d",
                    "defaultRating": 0,
                    "isFavorite": false,
                    "isSecured": false,
                    "details": {
                        "analog": true,
                        "format": "%.1f°"
                    },
                    "states": {
                        "entriesAndDefaultValue": "xxx-00e2-3280-ffff1e329f4d943d",
                        "mode": "xxx-00e2-32ab-ffff1e329f4d943d",
                        "modeList": "0eec2b1d-0322-1999-yyy",
                        "value": "xxx-00e2-3282-ffff1e329f4d943d"
                    }
                },
                "xxx-00e2-3281-ffff1e329f4d943d": {
                    "name": "Cooling",
                    "type": "IRCDaytimer",
                    "uuidAction": "xxx-00e2-3281-ffff1e329f4d943d",
                    "defaultRating": 0,
                    "isFavorite": false,
                    "isSecured": false,
                    "details": {
                        "analog": true,
                        "format": "%.1f°"
                    },
                    "states": {
                        "entriesAndDefaultValue": "xxx-00e2-3281-ffff1e329f4d943d",
                        "mode": "xxx-00e2-32ac-ffff1e329f4d943d",
                        "modeList": "0eec2b1d-0322-199a-yyy",
                        "value": "xxx-00e2-3283-ffff1e329f4d943d"
                    }
                }
            }
        },
JoDehli commented 6 months ago

@huliz I see. So you can try to make a custom sensor to display the target temp in ha. On the main page is a example how to integrate it. I think it is the first example. You need to replace the uuid with the uuid for your target temperature

JoDehli commented 6 months ago

@huliz I meant the uuid under states. On this uuid the state is reported.

huliz commented 6 months ago

now I feel stupid, it was much easier than I thought :) thanks a lot

JoDehli commented 6 months ago

@huliz No problem. Glad that it worked.