Change the hardware on existing devices Topic is solved

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Change the hardware on existing devices

Post by EddyG »

I use the "SolarEdge via Web API" hardware which creates 6 devices for years now.
Lately I have several errors on that hardware which annoys me.
Now I have a python script what does exactly the same but catches the errors. So devices could be updated "error free".
The problem is that when I disable the "SolarEdge via Web API" the devices are not displayed anymore.
The question is, could I change the the hardware Idx to one of my dummy hardware?
I suppose that the Device Idx is the only key used when I update a device via an API call.
Are the any other fields that I should consider, like DeviceID, Unit.
The "SolarEdge via Web API" is using Type 243 with SubTypes 1, 8, 29 and 31 and Type 80, SubType 5
I could go for Try and Error, but it is a production system, so I ask first.
Who has the answers?

B.t.w. These are the errors, several times a day.

Code: Select all

2021-08-31 09:27:49.661 Error: Solar_GeurtsPV hardware (15) thread seems to have ended unexpectedly
2021-08-31 09:28:03.666 Error: Solar_GeurtsPV hardware (15) thread seems to have ended unexpectedly
2021-08-31 09:28:06.913 Error: Solar_GeurtsPV: Error getting http data (Equipment details)!
2021-08-31 09:28:17.677 Error: Solar_GeurtsPV hardware (15) thread seems to have ended unexpectedly
User avatar
waltervl
Posts: 5907
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Change the hardware on existing devices

Post by waltervl »

If they are the same devices type you can use the replace function.
Disable (not delete) the old Solaris hardware so the old are not updated anymore but not deleted. Than you can replace (edit button) the old device by the new one and the history data of the old is taken over by the new device.
See also https://www.domoticz.com/wiki/Managing_ ... ace_device

If you have run them for a longer time on both hardware (native and python) it is better to start with a new python hardware to have no overlap in history data.

If they are not the same devices you can disable (not delete) the old hardware so old data can still be reported on the not updated devices.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Change the hardware on existing devices

Post by EddyG »

That is not what I ment.
I want to use the same devices (idx) as on my SolarEdge API hardware, but change the Hardware IDX in the device table to an Dummy Hardware by SQLite3 commands.
This way I can easy switch back as soon as the SolarEdge API hardware works normal again by doing the 'reverse' commands.
User avatar
waltervl
Posts: 5907
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Change the hardware on existing devices

Post by waltervl »

That is not possible without a lot of database hacking and a lot of risk. There is a post somewhere on this forum about this.
Why not using the replace function?????
If the Solaredge API is working again you can replace the devices again.....
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Change the hardware on existing devices

Post by EddyG »

Because nobody has the real answer, I decided to do it on the production system.
It just works!!!
Disable the SolarEdge API hardware and I create a new Dummy Hardware (HardwareID 39)
SQLite3 commands:

Code: Select all

UPDATE "DeviceStatus" SET "HardwareID" = 39 WHERE "HardwareID" = 15
and of course to go back:

Code: Select all

UPDATE "DeviceStatus" SET "HardwareID" = 15 WHERE "HardwareID" = 39
The new hardwareID 39 is updated by the python script every 5 minutes on the same Device idx.
That simple, it is possible, no replacing devices and so far no risk.
I think it should continue to work, because in the *_Calendar tables I see no relations to the HardwareID.
Last edited by EddyG on Tuesday 31 August 2021 17:04, edited 1 time in total.
User avatar
waltervl
Posts: 5907
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Change the hardware on existing devices

Post by waltervl »

Well then I remembered it different, the hacking was not that complex ;-)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Change the hardware on existing devices

Post by EddyG »

A day went by and the *_Calendar tables where updated fine.
So everything is working as it should be.
mgugu
Posts: 220
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Change the hardware on existing devices

Post by mgugu »

Looks like that question had already been answered by @waaren ...
viewtopic.php?f=28&t=36403&p=275743#p275743
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Change the hardware on existing devices

Post by EddyG »

Sharp!!! I already forgot about that post and the answer. I did not follow up yet on that Zigbee 'change' project.
So it was already far in the back of my mind where I could not reach for that info, problem comes with the years.
Glad that I did the jump here to be sure of the result.
mgugu
Posts: 220
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Change the hardware on existing devices

Post by mgugu »

@waaren is still with us !
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest