Custom component: Dahua VTO

hi all,

Created a custom component for my home intercom unit manufactured by Dahua,
Integration will be added soon to HACS repository,
for now you can add it to your HACS repo: elad-bar/ha-dahuavto or download it from:

Configuration for the component is being done through the Integration section (no YAML support):

Integration configuration of the VTO unit

name: custom name
host: hostname or ip
port: port of the VTO unit
username: Username to the web portal
password: Password to the web portal

Components:

binary_sensor.dahua_vto_available
State: represents whether the unit is online or not
Attributes:
    appAutoStart
    deviceType
    hardwareVersion
    processor
    serialNumber
    updateSerial
    updateSerialCloudUpgrade
    Last Ring
    Last Update
    CallType
    CreateTime
    EndState
    LocalNumber
    MessageTime
    PeerNumber
    PeerType
    RecNo
    TalkTime
    CreateDateTime
    CreatedDate
    device_class
binary_sensor.dahua_vto_ring
State: represents whether over the last 5 seconds there was a call
Attributes:
    appAutoStart
    deviceType
    hardwareVersion
    processor
    serialNumber
    updateSerial
    updateSerialCloudUpgrade
    Last Ring
    Last Update
    CallType
    CreateTime
    EndState
    LocalNumber
    MessageTime
    PeerNumber
    PeerType
    RecNo
    TalkTime
    CreateDateTime
    CreatedDate
    device_class

Enjoy

Hello, I tried it but when I put the configuration lines in the Yaml, and check it there is error,
is theere nothing missing at firt line to tell for witch it is like
dahua:

best regards

It works without YAML configuration, please add it through the integrations (Configuration -> Integrations)

I used this custom component, he work perfectly but when the bell rings "last Ring"marks two hours behind the current time.I checked all the time settings are correct. Also “last update” is correct.Do you have the solution to fix the problem?

Are the HA and VTO unit timezones and time synced?

yes they synchronized, “last update” shows the correct time.

I will check it during the weekend

I added this through Configuration -> Integrations but then get “This integration has no devices”
Anything else I should configure?

No, it creates 2 binary sensors, you can see them in developer -> states

Will add them as entities soon

ok thanks,could a sensor be triggered when the bell is pressed?

That’s how it supposed to work (for me it works at home)

Can you please provide me TZ / DST settings of your VTO unit / HA?

Thanks

forgive me did not understand what you ask? were you talking to me?

ah ok ok do you want a timezone? ok ROME +1

What kind of VTO does this work with?
I was looking into a 3211d and wondering if it would work for me using this integration.

@ghizmo82, I will try to reproduce it in my environment and will update

@danbutter, I have VTO1220BW

I will also add steps to check if your VTO unit support that integration during the weekend.

found the bug, I set the TZ to +2 with DST:
create_date_time = datetime.fromtimestamp(create_time - (3 * 60 * 60))

will fix it in few days, should be pretty simple

to check if your VTO unit supported by this component, please try to access the call log of the unit:
http://USERNAME:[email protected]/cgi-bin/recordFinder.cgi?action=find&name=VideoTalkLog

please post the result (private message),
If you got 404 page, it will not work

Updated the integration with the bug fix for the timezone, please let me know if it works for you

thanks

Added support for entities from integration section (Configuration -> Integrations)

ok i will try thanks