Comments (8)
in fresh install of raspberry pi i need this sudo apt-get install libavahi-compat-libdnssd-dev, now is working. i will keep testing and let you know
from hap-python.
Hi!
Try the below. There is another example in main.py
. If you have any more questions, please ask :)
Best,
Ivan
from pyhap.util import generate_mac
from pyhap.accessories.AM2302 import AM2302
from pyhap.accessories.ShutdownSwitch import ShutdownSwitch
from pyhap.accessory import Bridge
from pyhap.accessory_driver import AccessoryDriver
def create_bridge():
bridge = Bridge(display_name="pyhap", mac=generate_mac(), pincode=b"203-23-999")
am2302 = AM2302("DHT22")
shutdown_switch = ShutdownSwitch("Halt")
bridge.add_accessory(am2302)
bridge.add_accessory(shutdown_switch)
return bridge
def main():
bridge = create_bridge()
driver = AccessoryDriver(bridge, port=..., address=..., persist_file=...)
# signal.signal(signal.SIGINT, driver.signal_handler) optional
# signal.signal(signal.SIGTERM, driver.signal_handler) optional
driver.start()
from hap-python.
I can not make it work, i can see accessory mode in homekit but not bridge mode
from hap-python.
This is odd. What's in your code that starts the Bridge? Is it like the one above? Or if you are using main.py from HAP-python, did you delete the file accessory.pickle
before changing from accessory to bridge? (this file contains a cached accessory: after a restart of HAP-python, it reads from it and does not create a new accessory object, i.e. you may have changed the code, but the old state from the file is being used)
from hap-python.
i test it with main.py and the one above, y delete accessory.pickle too
from hap-python.
i just test it with fresh install of respbian, still not working :(
from hap-python.
I just got a clean copy of the project and I can see both Bridge and Accessory (I am using main.py), both from a mac OS and a Raspberry Pi.
Are you using a different mac address for the bridge (generate_mac()
provides a random one, so if you are using this - yes)? Have you tried starting it more than once?
Do you still see ONLY the Accessory and not the Bridge?
from hap-python.
Oh, avahi, for the mDNS, of course... I need to add this to the setup script. Thanks!
Yes, please let me know if you manage to run it properly (or if you don't) :)
from hap-python.
Related Issues (20)
- use of `socket.inet_aton` prevents ipv6 initialization
- Is orjson supported on 32-bit Raspberian? HOT 7
- installation hanging HOT 3
- notify multiple HomeKit Apps when switch state has changed HOT 6
- Unresponsive Pairing - WireShark dump shows no connection HOT 1
- How to run multiple accessories in 1 process? HOT 2
- Upgrading version 4.4 to 4.5 or 4.6 on rasperian bullseye (armv7l) HOT 2
- cannot find accessory.state HOT 3
- Device not discoverable in home assistant after unpairing twice
- is where a chance to give a bridge a Name, Model, serial number etc? HOT 1
- Homekit shared home support? HOT 1
- Orjson, requires a 64-bit Python with>3.8.5+and<3.9 HOT 13
- Any chance to support Category.AUDIO_RECEIVER ?
- Dehumidifier simple with WaterLevel HOT 4
- Add Support For Camera 2-way Audio
- Best Approach to Integrate with Existing Pi Django Server HOT 1
- CATEGORY_LIGHTBULB configure_char('Brightness'... ValueError("Characteristic not found" HOT 1
- Support for customer locks? HOT 1
- Since Raspberry Pi OS Upgrade Accessory Resets to Unpaired when Restarted HOT 1
- Stopped working after upgrading to iOS 17 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hap-python.