As someone who has found very little of working with HA / Node-RED self explanatory, and to answer your OP question
What did I do wrong?
I will attempt to provide an answer (and a correct one I hope).
Home Assistant has no entities of it’s own. Entities, including things like sensors, are all created by integrations. True, things like sun.sun and time. and home assistant all arrive ‘out of the box’, but everything ultimately is created by an integration.
The integration ‘registers’ the entity(ies) it wants with HA (usually at start-up time) and they then exist.
You have used an integration (hass-virtual) which has created two new sensor entities under the platform ‘virtual’.
HA has a very basic rule - only the integration that created an entity can manage that entity. Or, to put it another way, you can’t change a sensor state belonging to one integration from another.
There are, as always, exceptions to all of this.
The developer tools > states tool allows for any entity to have the state changed, but only for testing purposes, and the integration will overwrite this the next time the owning integration updates the sensor state.
Some integrations also provide services, and these may allow an update to a sensor state, and only by using the correct service call.
Node RED is (mostly used as) an addon, and the HA websocket nodes work as another ‘integration’.
The HA sensor node that you have used works just like other integrations.
It first registers (creates) the sensor
It then updates the sensor.state based on values you pass to it from the message payload etc.
The fact that your Entity config is called ‘sensor 1e33d75a8c1edc56’ is suggests that you have created the sensor node (the blue node ‘price buy’) without setting up the configuration node. Such names only appear if you do not give the sensor’s configuration node a name.
When you set up a HA sensor node,
You must also set up an Entity configuration node
This configuration node does the work of creating the sensor, naming it, and then passing the updated state values when you use the sensor node.
If you look in the Node-RED debug window, under configuration nodes, you will find the configuration nodes you have set up behind your sensor nodes.
Simply put, there is no way for you to connect your Node-RED created sensor to your HA config virtual platform created sensor. They exists on different integrations - all the Node-RED entities created in HA appear under the Node-RED Companion integration.
So how do you update your virtual sensor?
Well, if you have read down this far, there is great news!
I see that the creator of the ‘virtual’ integration has done a good job, and this integration includes a service that allows you to change the state of your sensors using a service call. Bingo (or whatever that would be in your native language).
https://github.com/twrecked/hass-virtual#sensors
Use the virtual.set service to manipulate the sensor value.
I don’t have this integration myself, but I would expect you to be able to find a service call available in HA called ‘virtual.set’. Check in Developer Tools > Services.
If you find and test this service call in HA, and it works, then you can use the HA websocket ‘service call’ node. This node is not without challenges to get the data field set correctly, but yes it should all work for you. You have choices!
Good luck with your project work.