{"id":20844452,"url":"https://github.com/fquinto/bticinoclasse300x","last_synced_at":"2025-02-27T16:19:32.786Z","repository":{"id":63728174,"uuid":"324616919","full_name":"fquinto/bticinoClasse300x","owner":"fquinto","description":"BTicino Classe 300X13E and C100X","archived":false,"fork":false,"pushed_at":"2024-08-27T07:55:48.000Z","size":2183,"stargazers_count":94,"open_issues_count":17,"forks_count":16,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-02-20T15:08:24.216Z","etag":null,"topics":["bticino","bticino-intercom","firmware","intercom","video","voip"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fquinto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-26T18:56:01.000Z","updated_at":"2025-02-14T10:45:47.000Z","dependencies_parsed_at":"2024-02-06T13:38:28.177Z","dependency_job_id":"2d981ee6-e060-4191-b1dd-bfccdb4c91cc","html_url":"https://github.com/fquinto/bticinoClasse300x","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fquinto%2FbticinoClasse300x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fquinto%2FbticinoClasse300x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fquinto%2FbticinoClasse300x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fquinto%2FbticinoClasse300x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fquinto","download_url":"https://codeload.github.com/fquinto/bticinoClasse300x/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240794978,"owners_count":19858722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bticino","bticino-intercom","firmware","intercom","video","voip"],"created_at":"2024-11-18T02:09:40.399Z","updated_at":"2025-02-27T16:19:32.758Z","avatar_url":"https://github.com/fquinto.png","language":"Python","funding_links":["https://www.paypal.com/donate/?business=XQQJHGVPHLD7W\u0026no_recurring=0\u0026item_name=Thank+you+for+collaborating+and+helping+the+development+of+software+improvements.\u0026currency_code=EUR"],"categories":[],"sub_categories":[],"readme":"# BTicino C100X/C300X modified firmware\n\n## Donations for Software Development\n\nhttps://www.paypal.com/donate/?business=XQQJHGVPHLD7W\u0026no_recurring=0\u0026item_name=Thank+you+for+collaborating+and+helping+the+development+of+software+improvements.\u0026currency_code=EUR\n\n## Firmware preparation and flashing\n\n\u003e If you need to use MQTT, first read [here](/mqtt_scripts/README.md) and insert the required information in TcpDump2Mqtt.conf. More info later\n\n### 1. Prepare and create firmware via python script\n\n[![asciicast](https://asciinema.org/a/514007.svg)](https://asciinema.org/a/514007)\n\n(Using GNU/Linux):\n\n```bash\ngit clone https://github.com/fquinto/bticinoClasse300x.git\ncd bticinoClasse300x\nsudo python3 -m pip install --upgrade pip\nsudo python3 -m pip install -r requirements.txt\nsudo python3 main.py\n```\n\n(Using Docker):\n\n```bash\ngit clone https://github.com/fquinto/bticinoClasse300x.git\ncd bticinoClasse300x\ndocker compose run bticino\n```\n\n### 2. Flash firmware using MyHomeSuite\n\n- Download and install \"My Home Suite\" configuration software (Windows only) from [the official page](https://www.homesystems-legrandgroup.com/en/home/-/productsheets/2493426)\n\n- Unmount the intercom from the wall and, while still connected to the SCS 2-wire bus, connect to the intercom via the Mini-USB port located on the back. See the following technical sheets for USB port location: [C100X](https://www.homesystems-legrandgroup.com/MatrixENG/liferay/bt_mxLiferayCheckout.jsp?fileFormat=generic\u0026fileName=ST-00000695-EN.pdf\u0026fileId=58107.23188.48156.49690) - [C300X](https://www.homesystems-legrandgroup.com/MatrixENG/liferay/bt_mxLiferayCheckout.jsp?fileFormat=generic\u0026fileName=ST-00000361-EN.pdf\u0026fileId=58107.23188.48057.62932)\n\n- Follow the steps shown in the following animation to select your specific device model and flash it with firmware generated by the script in step 1\n![](/myhome_flash.gif)\n\n---\n\n## Device integration capabilities\n\n**NOTE**: \u003cintercom_ip\u003e is the IP address of the video intercom door entry unit.\n\n### 1. Via any generic MQTT broker\n\nTo better understand MQTT implementation, have a look [here](/mqtt_scripts/README.md)\n\nOnce you flashed the new firmware, establish a connection with your intercom via SSH\n\n```sh\nssh root2@\u003cintercom_ip\u003e\n```\n\nIf you're using a mac (OSx)\n\n```sh\n# First create a RSA key if you never done before\nssh-keygen -t rsa\n\n# Do the connection\nssh -oHostKeyAlgorithms=+ssh-rsa root2@\u003cintercom_ip\u003e\n```\n\nProceed with all the following\n\n```sh\n# Move to the folder\ncd /etc/tcpdump2mqtt\n\n# Make the filesystem writable.\nmount -oremount, rw /  \n\n# Modify the config file with your MQTT parameters (server, user and password)\nvi TcpDump2Mqtt.conf \n\n# Make the filesystem read-only again.\nmount -oremount, ro /\n\n# Restart the video door entry unit.\nreboot    \n```\n\nOur intercom is now sending / receiving any commands to the MQTT broker.\n\n### 2. Homeassisant via an MQTT broker\n\n**NOTE**: In order to manage MQTT topics in Homeassistant it is necessary to have the MQTT integration installed and have followed the instructions in the previous step\n\n* Basic configuration\n\n    In the Homeassistant **configuration.yaml** file, in the **mqtt:** block it is necessary to insert the following lines to instruct MQTT to receive / transmit on the topics we have defined in the firmware creation script:\n\n    ```yaml\n    mqtt:\n      sensor:\n        - unique_id: '14532784978700'\n          name: \"Video intercom TX\"\n          state_topic: \"Bticino/tx\"\n          availability_topic: \"Bticino/LastWillT\"\n          icon: mdi:phone-outgoing\n\n        - unique_id: '13454564689485'\n          name: \"Video intercom RX\"\n          state_topic: \"Bticino/rx\"\n          availability_topic: \"Bticino/LastWillT\"\n          icon: mdi:phone-incoming\n    ```\n\n* Automations\n\n    We need to create automations that allow us to interact with the video door entry unit.\n\n    - Open the door\n    \n        The following automation creates a button that allows the gate to be opened and creates a notification in the Homeassistant notification area.\n\n        ```yaml\n            - id: '1656918057723'\n              alias: Apertura Cancelletto Pedonale\n              description: ''\n              trigger:\n              - platform: state\n                entity_id:\n                - input_button.cancelletto_pedonale\n              condition: []\n              action:\n              - service: notify.persistent_notification\n                data:\n                  message: Il cancello pedonale è aperto\n              - service: mqtt.publish\n                data:\n                  topic: Bticino/rx\n                  payload: '*8*19*20##'\n              - delay:\n                  hours: 0\n                  minutes: 0\n                  seconds: 1\n                  milliseconds: 0\n              - service: mqtt.publish\n                data:\n                  payload: '*8*20*20##'\n                  topic: Bticino/rx\n              mode: single\n        ```\n\n    - Recognize the commands\n    \n        The following automation recognizes some commands received from the video door entry unit and notifies the event. Obviously the notification scripts shown in the automation will have to be replaced with the one you want.\n\n        ```yaml\n            - id: '1657896199804'\n              alias: Notifiche dal citofono\n              description: ''\n              trigger:\n              - platform: state\n                entity_id:\n                - sensor.video_intercom_tx\n              action:\n              - choose:\n                - conditions:\n                  - condition: state\n                    entity_id: sensor.video_intercom_tx\n                    state: '*8*21*10##'\n                  sequence:\n                  - service: script.notifica_voce_evento\n                    data:\n                      notification_message: \"La luce scala è stata attivata\"\n                  - service: script.notifica_testo_evento\n                    data:\n                      notification_message: \"La luce scala è stata attivata\"\n                - conditions:\n                  - condition: state\n                    entity_id: sensor.video_intercom_tx\n                    state: '*8*19*20##'\n                  sequence:\n                  - service: script.notifica_voce_evento\n                    data:\n                      notification_message: \"Il cancelletto è stato aperto\"\n                  - service: script.notifica_testo_evento\n                    data:\n                      notification_message: \"Il cancelletto è stato aperto\"\n                default: []\n              mode: single\n        ```\n\n### 3. Via remote shell scripting\n\n- Example one:\n\n    ```sh\n    #!/usr/bin/expect -f\n    spawn ssh \u003cintercom_ip\u003e\n    expect \"assword:\"\n    send \"pwned123\\r\"\n    expect \"root@C3X-00-03-50-xx-xx-xx-yyyyyyy:~#\"\n    send \"echo *8*19*20## |nc 0 30006\\r\"\n    send \"sleep 1\\r\"\n    send \"echo *8*20*20##|nc 0 30006\\r\"\n    send \"exit\\r\"\n    interact\n    ```\n\n- Example two:\n\n    ```sh\n    #!/bin/bash\n    sshpass -p pwned123 ssh -o StrictHostKeyChecking=no \u003cintercom_ip\u003e \"echo *8*19*20## |nc 0 30006; sleep 1; echo *8*20*20##|nc 0 30006\"\n    ```\n\n- Example 3 (direct test):\n\n    ```sh\n    ssh \u003cintercom_ip\u003e 'echo *8*19*20## | nc 0 30006; sleep 1; echo *8*20*20## | nc 0 30006'\n    ```\n\n### Home Assistant via shell scripts\n\nDepending on your configuration, you may need to create a script to write commands in HA.\n\nIn next example are both. You can use only one (you don't need both if one it's running ok).\n\n- Add your script in `shell_components` folder\n\n- Configure in HA:\n  ```yaml\n  shell_command:\n    openbuildingdoor: \"/home/homeassistant/.homeassistant/shell_commands/openbuildingdoor.sh\"\n    openbuildingdoor2: \"ssh bticino 'echo *8*19*20## |nc 0 30006; sleep 1; echo *8*20*20##|nc 0 30006'\"\n  ```\n\n- In your `ui-lovelace.yaml`:\n  ```yaml\n  cards:\n    - type: button\n        name: Open building door CMD1\n        show_state: false\n        show_name: true\n        show_icon: true\n        tap_action:\n          action: call-service\n          service: shell_command.openbuildingdoor\n    - type: button\n        name: Open building door CMD2\n        show_state: false\n        show_name: true\n        show_icon: true\n        tap_action:\n          action: call-service\n          service: shell_command.openbuildingdoor2\n  ```\n\n## OpenWebNet commands\n\n### Known commands / notifications\n\n| Command | Description |\n| --- | --- |\n| \\*8\\*19\\*20## | main door opening button pressed |\n| \\*8\\*20\\*20## | main door opening button released |\n| \\*8\\*19\\*21## | secondary door opening button pressed |\n| \\*8\\*20\\*21## | secondary door opening button released |\n| \\*8\\*21\\*10## | stairs light activated |\n| \\*8\\*1#5#4#20\\*10## | intercom camera on |\n| \\*8\\*3#5#4\\*420##  | intercom camera off |\n| \\*8\\*1#1#4#21\\*10## | incoming external call |\n| \\*8\\*1#1#4#21\\*11## | incoming external call |\n| \\*8\\*1#1#4#21\\*16## | incoming external call |\n| \\*7\\*59#12#0#0\\*## | incoming internal call |\n\n### Explore new commands\n\nYou can discover new command in the following ways\n\n- Via MQTT sniffing: use any MQTT listening app / HA integrated MQTT topic listener\n\n- Via TCP sniffing:\n  * Go to your home: `cd ~`\n  * On your Linux computer type: \n  `ssh root2@192.168.1.97 '/usr/sbin/tcpdump -i lo -U -w - \"not port 22\"' \u003e recordingsFILE`\n  * Use the App on your mobile and open the door or whatever you want to \"learn\"\n  * Stop data recording with CTRL+C\n  * Open recordingsFILE: `wireshark ~/recordingsFILE`\n\n---\n\n## Telegram Channel from which all of this originated\n\nhttps://t.me/bTicinoClasse300x\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffquinto%2Fbticinoclasse300x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffquinto%2Fbticinoclasse300x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffquinto%2Fbticinoclasse300x/lists"}