Closed Nico0W closed 4 weeks ago
@Nico0W I think it is not possible to secure a cover with normal UI elements. You can try to open the door via a secure websocket call. If this works you can try to combine it with a custom UI element where you can input a code. There a view custom elements available.
I'm really struggling to make it works...
I used ChatGPT to help me and i've added this to my configuration.yalm:
input_text:
door_code:
name: Code pour la porte
min: 4
max: 4
pattern: '[0-9]{4}'
mode: password
input_button:
validate_code:
name: Valider le code
shell_command:
open_door: 'python3 /config/loxone_ws_client.py {{ code }}'
automation: !include automations.yaml
script: !include scripts.yaml
This to automation.yalm
`- alias: "Valider le code pour ouvrir la porte"
trigger:
platform: state
entity_id: input_button.validate_code
to: 'pressed'
action:
- service: shell_command.open_door
data:
code: "{{ states('input_text.door_code') }}"
`
and created this page in my configuration folder:
`import asyncio
import websockets
import ssl
import json
import sys
LOXONE_HOST = '192.168.1.100' # Remplacez par l'adresse IP de votre Loxone Miniserver
LOXONE_PORT = 8080 # Remplacez par le port de votre Loxone Miniserver
LOXONE_USER = 'your_loxone_username'
LOXONE_PASSWORD = 'your_loxone_password'
LOXONE_DOOR_UUID = 'loxone_door_uuid' # Remplacez par l'UUID de votre porte Loxone
CORRECT_CODE = '1234' # Remplacez par le code correct
async def open_door_if_code_correct(entered_code):
if entered_code == CORRECT_CODE:
uri = f'wss://{LOXONE_HOST}:{LOXONE_PORT}/ws/rfc6455'
ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
async with websockets.connect(uri, ssl=ssl_context) as websocket:
command = f'jdev/sps/io/{LOXONE_DOOR_UUID}/pulse'
await websocket.send(json.dumps({'method': command}))
response = await websocket.recv()
print(response)
else:
print("Incorrect code")
if __name__ == '__main__':
if len(sys.argv) != 2:
print("Usage: python3 loxone_ws_client.py <entered_code>")
else:
entered_code = sys.argv[1]
asyncio.run(open_door_if_code_correct(entered_code))`
And it doens't seems to want to work. What have I done wrong ?
That's like my Mechanical Ventilation. In the Loxone app, I can control the speed, not in HA. Only see sensors about temperature and speed and have a button to switch to automatic mode. I would like to manually change the speed, like the app:
Do you have any idea on how i can control it ?
@Nico0W do you still have this problem? ChatGpt is the wrong solution for this. ;-)
Yes, I still have the problem.
I did not solve it, nothing worked with ChatGPT. Without help, it's completely out of my knowledge :-(
@Nico0W
Here is a solution how I would do it:
cover:
platform: template covers: garage_door: device_class: garage friendly_name: "Garage Door with Code" position_template: > {% set position = states.cover.tor.attributes.current_position | default(0) %} {{ position }} open_cover:
service: input_text.set_value data: value: "" target: entity_id: input_text.code
close_cover:
IMPORTANT:
Then put the Input and the template Cover to any dashboard an try it. If this works you can hide the original cover which pyloxone auto generated.
@Nico0W and please do not only use chatGPT and read more in the documentation. ChatGPT is not the solution for such a problem.
Describe the bug
Hello,
I'm not able to control my Hormann garage door with HA. The door works well with Loxone and I've got the possibility to control it with Pyloxone but the door don't move cause it needs the security code. When I use it in Loxone, I have to insert the code. Where have I to put this code to control the door ?
Thanks for your help! It makes me crazy!
Firmware of your Miniserver
Gen. 1 Firmware 14.5.12.7
HomeAssistant install method
RPI 4 server
Version of HomeAssistant
2024.7.2
Version of Pyloxone
Last one.
Update pyloxone
Successfully.
Log
Settings for the log can be found on the main page under the section Log Configuration