meatpiHQ / wican-fw

Other
223 stars 47 forks source link

Suggest engage the Home Assistant community to encurage an integration for WiCAN-OBD2 over WiFi/BLE and other CAN Bus OBD-II/OBD2 adapters #3

Open Hedda opened 1 year ago

Hedda commented 1 year ago

Not exactly an issue, however, I would like to suggest and recommend that you try to engage with the Home Assistant community to encourage a Home Automation "integration" (also referred to as "integration component" and "custom component") for WiCAN-OBD2 over WiFi/BLE and other Wi-Fi/BLE specifically or a generic integration for CAN Bus OBD-II/OBD2 (OBD/EOBD+CANbus) adapters which supports the same APIs and protocols for third-party integrations.

Check out feature request discussion -> https://community.home-assistant.io/t/support-for-can-bus-peak-ixxat-canable-etc/249639/

Home Assistant is an open-source home automation software application and is currently the world's most popular platform for home automation enthusiasts, primarily because it makes it relatively easy for developers to make third-party integrations for it so it, therefore, has more third-party integrations than other home automation framework, and it is also one of the most active Python-based projects on GitHub.

https://en.wikipedia.org/wiki/Home_Assistant

https://github.com/home-assistant/

https://www.home-assistant.io/

Home Assistant community members have requested support for different OBD-II/OBD2 adapters for a long time in order to both use it as a device tracker and/or presence detection of their cars and trucks (when it connects you to your Wi-Fi at home) as well as get data information about things like battery and fuel level status which is useful in home automation use cases like sending status notifications when the car/truck arrive at home or when battery or fuel is low.

See example:

https://developers.home-assistant.io/docs/development_index/

https://developers.home-assistant.io/docs/dev_101_services/

https://developers.home-assistant.io/docs/creating_component_index/

https://www.youtube.com/watch?v=e3VwPb72Bbg

https://www.youtube.com/watch?v=6LHeoUS1R40

https://www.youtube.com/watch?v=_yVzgrGt1ok

Personally, I would love to have a new integration which combine sensors, binary sensors, and device tracker and/or presence detection (person tracking) for knowing vehicles location prioritized if there is developer interest in that:

https://www.home-assistant.io/integrations/device_tracker/

https://www.home-assistant.io/integrations/#presence-detection

https://www.home-assistant.io/integrations/person/

https://www.home-assistant.io/integrations/proximity/

https://www.home-assistant.io/integrations/ping/

https://www.home-assistant.io/integrations/zone/

Hedda commented 1 year ago

Here are by the way some somewhat similar sensor integrations for HA, most of these only offer "sensors" and "binary sensors" but some of these have offer some type of device tracker and/or presence detection as well:

https://www.home-assistant.io/integrations/#car

https://www.home-assistant.io/integrations/torque/

https://www.home-assistant.io/integrations/bmw_connected_drive/

https://www.home-assistant.io/integrations/dacia/

https://www.home-assistant.io/integrations/mazda/

https://www.home-assistant.io/integrations/nissan_leaf/

https://www.home-assistant.io/integrations/subaru/

https://www.home-assistant.io/integrations/volvooncall/

https://brands.home-assistant.io/_/nsw_fuel_station/logo.png

https://www.home-assistant.io/integrations/openevse/

https://www.home-assistant.io/integrations/juicenet/

https://www.home-assistant.io/integrations/traccar/

https://www.home-assistant.io/integrations/tractive/

https://www.home-assistant.io/integrations/owntracks/

https://www.home-assistant.io/integrations/fleetgo/

https://www.home-assistant.io/integrations/mqtt_room/

https://www.home-assistant.io/integrations/device_sun_light_trigger/

https://www.home-assistant.io/integrations/asuswrt/

There's also more integrations for other non-car related bus protocols which present sensors and binary sensor, etc. entities to Home Assistant, ex:

https://www.home-assistant.io/integrations/velbus/

https://www.home-assistant.io/integrations/ubus/

https://www.home-assistant.io/integrations/modbus/

meatpiHQ commented 1 year ago

@Hedda I'm interested in this, I'll engage with HASS community to understand the requirements.

Hedda commented 1 year ago

@Hedda I'm interested in this, I'll engage with HASS community to understand the requirements.

@meatpiHQ Cool! I am sure that the Home Assistant have loads of eager early adopters that would be willing to buy your WiCAN and be willing alpha/beta testers once there is a compatible custom integration component available.

Would be awesome if you could either write a new custom integration component yourself or try to find an other interested developer in the Home Assistant community to develop an integration component which can talk to WiCAN over WiFi and/or BLE using one of the protocols and/or APIs that you already support in the existing firmware.

Again, I think what is wanted is to have a new custom integration component that can present several "sensors", "binary sensor", and "device tracker" or "presence detection" as a device with several entities inside Home Assistant to be able to see both state changes of those entries as well as location (at least tracking connection status to Wi-Fi and/or Bluetooth). See:

Tip if you are not wanting to continue developing all by yourself is to make it a little more generic "Car/Truck OBD and CAN Bus" custom integration than one specific to only WiCAN, and as such you might want to make either a generic "Car/Truck OBD and CAN Bus" custom integration that can be extended by both yourself and other volunteering developers in the future to support multiple protocols (like BUSMASTER, slcand, SavvyCAN, and RealDash) in one single unified generic "Car/Truck OBD and CAN Bus" custom integration, or just make a generic custom integration for a specific for only one of the protocol and/or API that WiCAN support, like for example a dedicated "BUSMASTER", "slcand", "SavvyCAN", or "RealDash" custom integration specifcially only for that protocol/API working together with the BUSMASTER, slcand, SavvyCAN, or RealDash communities.

RoganDawes commented 1 year ago

Depending on the interface exposed via WiFi, you might also want to consider looking at the ESPHome project as a firmware environment, which integrates tightly with Home Assistant.

Hedda commented 1 year ago

Depending on the interface exposed via WiFi, you might also want to consider looking at the ESPHome project as a firmware environment, which integrates tightly with Home Assistant.

Yes but using an open protocol standard like MQTT or similar would probably make it easier to integrate for developers of other home automation projects/products that are not Home Assistant (like example OpenHAB, Domoticz, Hubitat, Homey, etc. ), or?

meatpiHQ commented 1 year ago

@RoganDawes @Hedda I prefer to keep the integration generic, and yes MQTT makes a lot of sense for this application.

I think here we have 2 possible applications.

MQTT implementation

Hedda commented 1 year ago

FYI, if you ever wanted to use a native integration specific to Home Assistant without need to MQTT then there is "Home Assistant WebSocket API" which for example is used by the ESPHome integration and the Z-Wave (Z-Wave) integration in Home Assistant:

https://www.home-assistant.io/integrations/websocket_api/

@meatpiHQ suggest however checking out Home Assistant's existing MQTT-based integrations for different device types and services, so if you could add MQTT client support and publish relevant functions/features as MQTT topics in firmware first then you (or someone else) could probably make a new generic "Car/Truck OBD and CAN Bus" custom integration as a virtual "hub" for Home Assistant that makes use of all different existing MQTT device types and services by subscribing to the correct MQTT topics and present the WiCAN Can Bus adapter as "hub" that present "devices" with multiple "entities" that stream "events" and different support "device types" (example "sensor", "binary sensor", etc.) to Home Assistant:

https://www.home-assistant.io/integrations/#hub

See example existing integrations "Velbus", "Modbus", and "OpenTherm Gateway" integrations which all acts as a "hub" integration (hubs == gateways/bridges with APIs, meaning they can abstract multiple devices which they, in turn, can present to Home Assistant in a uniformed matter to Home Assistant), as well as the "MQTT Alarm Control Panel" which is an "alarm" category integration:

https://www.home-assistant.io/integrations/velbus/ https://www.home-assistant.io/integrations/modbus/ https://www.home-assistant.io/integrations/opentherm_gw/ https://www.home-assistant.io/integrations/manual_mqtt/

Anyway, there are already loads of MQTT integrations which in turn can be used from other integrations as dependencies:

https://www.home-assistant.io/integrations/#search/mqtt https://www.home-assistant.io/integrations/mqtt/ https://www.home-assistant.io/integrations/mqtt_eventstream/ https://www.home-assistant.io/integrations/mqtt_statestream/ https://www.home-assistant.io/integrations/binary_sensor.mqtt/ https://www.home-assistant.io/integrations/sensor.mqtt/ https://www.home-assistant.io/integrations/device_trigger.mqtt/ https://www.home-assistant.io/integrations/number.mqtt/ https://www.home-assistant.io/integrations/select.mqtt/ https://www.home-assistant.io/integrations/button.mqtt/ https://www.home-assistant.io/integrations/switch.mqtt/ https://www.home-assistant.io/integrations/light.mqtt/ https://www.home-assistant.io/integrations/scene.mqtt/ https://www.home-assistant.io/integrations/lock.mqtt/ https://www.home-assistant.io/integrations/alarm_control_panel.mqtt/ https://www.home-assistant.io/integrations/siren.mqtt/ https://www.home-assistant.io/integrations/fan.mqtt/ https://www.home-assistant.io/integrations/climate.mqtt/ https://www.home-assistant.io/integrations/device_tracker.mqtt/ https://www.home-assistant.io/integrations/mqtt_json/

Also check out other "helper", "utility", and "automation" integrations that they have which can be used in your integration:

https://www.home-assistant.io/integrations/#helper https://www.home-assistant.io/integrations/#utility https://www.home-assistant.io/integrations/#automation

PS: Might also be a nice feature to include the export integration diagnostics for troubleshooting the integration for HA, see:

https://www.home-assistant.io/integrations/diagnostics/

nebriv commented 1 year ago

I don't have much to add currently as far as ideas or suggestions but I do want to chime in and say awesome!! I love this idea, I actually backed this production with the intention on setting up home assistant integration. So I was thrilled to see the email indicating it was being considered!

I'd personally lean towards the MQTT side. Seems the most straightforward to implement and also more reusable.

meatpiHQ commented 1 year ago

MQTT is now supported. I also decided against make implementing OBD2 protocol with auto requests.

I will post a working example on how to use the WiCAN MQTT with HA.

meatpiHQ commented 1 year ago

I've added some instruction on how to use WiCAN with Home assistant.

amuntavant commented 1 year ago

I just received my first wican! I'm very impressed with this project. I love it! Thank you very much for all the effort you are making!

Yesterday, I implanted the Wican in my Peugeot Expert Motorhome which is 2 years old. The vehicle has a 4G Router and Homeassistant as its brain. This morning I just received the outside ambient temperature for the first time by MQTT/Node Red (following your instructions). I am very excited!.

And I'm looking forward to see more Canbus information on Homeassistant. Who knows, maybe one day we can turn the car volume up and down from Home Assistant!

I will closely follow the project and the future integration with Home Assistant. If you need help, or data from a vehicle with Wican connected 24/7, do not hesitate to contact me!

Thanks!

flyrmyr commented 1 year ago

@amuntavant I have a similar setup: Converted Promaster Van, 5G router, RPi4 running HAssio. Everything running full time (except the engine..). Got my WiCan, getting data through to my MQTT, setting up reading with NodeRed. But, its my only use for NodeRed, and I feel like it could just be its own integration instead of needing the NodeRed parsing the CanBus output. Have you heard of anyone bypassing that, with HA just reading the bus data directly?

typxxi commented 3 months ago

any updates about the integration idea cause that was the key to let me buy the stick to get a fully integrated solution in the end independent from Volkswagen cloud.

Would be nice to see such solution happen cause right now I feel a bit lost without a way to get things started. thx.